Package org.robwork.sdurw_simulation
Class SimulatorPtr
- java.lang.Object
-
- org.robwork.sdurw_simulation.SimulatorPtr
-
public class SimulatorPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description SimulatorPtr()
Default constructor yielding a NULL-pointer.SimulatorPtr(long cPtr, boolean cMemoryOwn)
SimulatorPtr(Simulator 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 Simulator
__ref__()
Dereferencing operator.void
delete()
Simulator
deref()
The pointer stored in the object.boolean
equals(Simulator p)
ControllerPtr
getController(java.lang.String name)
get controller with specific namestatic long
getCPtr(SimulatorPtr obj)
Simulator
getDeref()
Member access operator.PropertyMap
getPropertyMap()
get propertymap of this simulatorSensorPtr
getSensor(java.lang.String name)
get sensor with specific nameState
getState()
get current state of simulatordouble
getTime()
gets the the current simulated timevoid
init(State state)
initialize simulator with state variablesboolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
reset(State state)
reset velocity and acceleration of all bodies to 0.void
setEnabled(FramePtr frame, boolean enabled)
Enables or disables simulation of a frame
Conditional comment:void
step(double dt)
take a step forward in time with timestep dt.
-
-
-
Constructor Detail
-
SimulatorPtr
public SimulatorPtr(long cPtr, boolean cMemoryOwn)
-
SimulatorPtr
public SimulatorPtr()
Default constructor yielding a NULL-pointer.
-
SimulatorPtr
public SimulatorPtr(Simulator ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SimulatorPtr obj)
-
delete
public void delete()
-
deref
public Simulator deref()
The pointer stored in the object.
-
__ref__
public Simulator __ref__()
Dereferencing operator.
-
getDeref
public Simulator getDeref()
Member access operator.
-
equals
public boolean equals(Simulator 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
-
step
public void step(double dt)
take a step forward in time with timestep dt.- Parameters:
dt
- [in] the time step
-
reset
public void reset(State state)
reset velocity and acceleration of all bodies to 0. And sets the position of all
bodies to that described in state
-
init
public void init(State state)
initialize simulator with state variables
-
getTime
public double getTime()
gets the the current simulated time
-
getState
public State getState()
get current state of simulator- Returns:
- current state of simulator
-
setEnabled
public void setEnabled(FramePtr frame, boolean enabled)
Enables or disables simulation of a frame
Conditional comment:- Parameters:
frame
- [in]enabled
- [in]
End of conditional comment.
-
getPropertyMap
public PropertyMap getPropertyMap()
get propertymap of this simulator
-
getSensor
public SensorPtr getSensor(java.lang.String name)
get sensor with specific name
-
getController
public ControllerPtr getController(java.lang.String name)
get controller with specific name
-
-