Class ObjectPtr


  • public class ObjectPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • ObjectPtr

        public ObjectPtr​(long cPtr,
                         boolean cMemoryOwn)
      • ObjectPtr

        public ObjectPtr()
        Default constructor yielding a NULL-pointer.
      • ObjectPtr

        public ObjectPtr​(Object ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(ObjectPtr obj)
      • delete

        public void delete()
      • deref

        public Object deref()
        The pointer stored in the object.
      • __ref__

        public Object __ref__()
        Dereferencing operator.
      • getDeref

        public Object getDeref()
        Member access operator.
      • equals

        public boolean equals​(Object 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
      • 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​(Frame frame)
        associate a frame to this Object.
        Parameters:
        frame - [in] frame to associate to object
      • getGeometry

        public GeometryPtrVector getGeometry()
        get default geometries
        Returns:
        geometry for collision detection
      • getGeometry

        public GeometryPtrVector getGeometry​(State state)
        get geometry of this object
        Returns:
        geometry for collision detection.
      • getModels

        public Model3DPtrVector getModels()
        get the default models
        Returns:
        models for vizualization
      • getModels

        public Model3DPtrVector getModels​(State state)
        get visualization models of this object
        Returns:
        models for visualization
      • getMass

        public double getMass​(State state)
        get mass in Kg of this object
        Returns:
        mass in kilo grams
      • getCOM

        public Vector3Dd getCOM​(State state)
        get center of mass of this object
        Parameters:
        state - [in] the state in which to get center of mass
        Returns:
      • getInertia

        public InertiaMatrixd getInertia​(State state)
        returns the inertia matrix of this body calculated around COM with the orientation
        of the base frame.
      • 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.