Class RigidObjectPtr


  • public class RigidObjectPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • 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

      • 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.
      • 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
      • 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
      • 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.