Package org.robwork.sdurw_models
Class RigidObjectPtr
- java.lang.Object
-
- org.robwork.sdurw_models.RigidObjectPtr
-
public class RigidObjectPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description RigidObjectPtr()Default constructor yielding a NULL-pointer.RigidObjectPtr(long cPtr, boolean cMemoryOwn)RigidObjectPtr(RigidObject ptr)Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RigidObject__ref__()Dereferencing operator.voidaddFrame(FramePtr frame)associate a frame to this Object.voidaddGeometry(GeometryPtr geom)add collision geometry from this objectvoidaddModel(Model3DPtr model)add visualization model to this objectvoidapproximateInertia()approximates inertia based on geometry, mass and center of mass propertiesvoidapproximateInertiaCOM()approximates inertia and center of mass based on geometry and mass propertiesRigidObjectCPtrcptr()voiddelete()RigidObjectderef()The pointer stored in the object.booleanequals(RigidObject p)FramegetBase()get base frame of this objectVector3DgetCOM()get the center of mass of this rigid body seen in the base frameVector3DgetCOM(State state)static longgetCPtr(RigidObjectPtr obj)RigidObjectgetDeref()Member access operator.FrameVectorgetFrames()get all associated frames of this objectVectorGeometryPtrgetGeometry()get geometry of this rigid objectInertiaMatrixdgetInertia()get the inertia matrix of this rigid body seen in the base frameInertiaMatrixdgetInertia(State state)doublegetMass()returns the mass of this RigidObjectdoublegetMass(State state)Model3DPtrVectorgetModels()get visualization models for this rigid objectjava.lang.StringgetName()get name of this object.StateStructurePtrgetStateStructure()Get the state structure.booleanisNull()checks if the pointer is nullbooleanisRegistered()Check if object has registered its state.booleanisShared()check if this Ptr has shared ownership or none
ownershipvoidregisterIn(State state)initialize this stateless data to a specific statevoidregisterIn(StateStructurePtr state)register this stateless object in a statestructure.voidremoveGeometry(GeometryPtr geom)remove collision geometry from this objectvoidremoveModel(Model3DPtr model)remove visualization model to this rigid objectvoidsetCOM(Vector3D com)set the center of mass of this rigid body seen in the base framevoidsetInertia(InertiaMatrixd inertia)set inertia of this rigid objectvoidsetMass(double mass)set mass of this RigidObjectvoidunregister()unregisters all state data of this stateless object
-
-
-
Constructor Detail
-
RigidObjectPtr
public RigidObjectPtr(long cPtr, boolean cMemoryOwn)
-
RigidObjectPtr
public RigidObjectPtr()
Default constructor yielding a NULL-pointer.
-
RigidObjectPtr
public RigidObjectPtr(RigidObject ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(RigidObjectPtr obj)
-
delete
public void delete()
-
deref
public RigidObject deref()
The pointer stored in the object.
-
__ref__
public RigidObject __ref__()
Dereferencing operator.
-
getDeref
public RigidObject getDeref()
Member access operator.
-
equals
public boolean equals(RigidObject p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public RigidObjectCPtr cptr()
-
addGeometry
public void addGeometry(GeometryPtr geom)
add collision geometry from this object- Parameters:
geom- [in] the geometry to add
-
removeGeometry
public void removeGeometry(GeometryPtr geom)
remove collision geometry from this object- Parameters:
geom- [in] the geometry to remove
-
addModel
public void addModel(Model3DPtr model)
add visualization model to this object- Parameters:
model- [in] the model to be added
-
removeModel
public void removeModel(Model3DPtr model)
remove visualization model to this rigid object- Parameters:
model- [in] the model to be removed
-
getMass
public double getMass()
returns the mass of this RigidObject- Returns:
- mass of the Object
-
getMass
public double getMass(State state)
-
setMass
public void setMass(double mass)
set mass of this RigidObject- Parameters:
mass- [in] the mass of this object
-
getInertia
public InertiaMatrixd getInertia()
get the inertia matrix of this rigid body seen in the base frame- Returns:
- IntertiaMatrix
-
getInertia
public InertiaMatrixd getInertia(State state)
-
setInertia
public void setInertia(InertiaMatrixd inertia)
set inertia of this rigid object- Parameters:
inertia- [in] the inertia of this object
-
getCOM
public Vector3D getCOM()
get the center of mass of this rigid body seen in the base frame- Returns:
- the center of mass 3D coordinate
-
setCOM
public void setCOM(Vector3D com)
set the center of mass of this rigid body seen in the base frame
-
approximateInertia
public void approximateInertia()
approximates inertia based on geometry, mass and center of mass properties
-
approximateInertiaCOM
public void approximateInertiaCOM()
approximates inertia and center of mass based on geometry and mass properties
-
getGeometry
public VectorGeometryPtr getGeometry()
get geometry of this rigid object- Returns:
- a list of all Geometries
-
getModels
public Model3DPtrVector getModels()
get visualization models for this rigid object- Returns:
- a list of all models
-
getName
public java.lang.String getName()
get name of this object. Name is always the same as the name of the
base frame.- Returns:
- name of object.
-
getBase
public Frame getBase()
get base frame of this object- Returns:
- base frame of object
-
getFrames
public FrameVector getFrames()
get all associated frames of this object- Returns:
- a vector of frames
-
addFrame
public void addFrame(FramePtr frame)
associate a frame to this Object.- Parameters:
frame- [in] frame to associate to object
-
registerIn
public void registerIn(State state)
initialize this stateless data to a specific state- Parameters:
state- [in] the state in which to register the data.
Note: the data will be registered in the state structure of the state
and any copies or other instances of the state will therefore also
contain the added states.
-
registerIn
public void registerIn(StateStructurePtr state)
register this stateless object in a statestructure.
-
unregister
public void unregister()
unregisters all state data of this stateless object
-
getStateStructure
public StateStructurePtr getStateStructure()
Get the state structure.- Returns:
- the state structure.
-
isRegistered
public boolean isRegistered()
Check if object has registered its state.- Returns:
- true if registered, false otherwise.
-
-