#include <CscPhysicsSimulator.h>
Classes | |
| struct | BaseEntityOutputPhysicsState |
| struct | CscEntityPhysicsState |
| struct | MemberPhysicsState |
| struct | MemberState |
| struct | PivotPhysicsState |
| struct | PropellerPhysicsState |
| struct | TranslationPhysicsState |
| struct | WheelPhysicsState |
Public Types | |
| typedef int | EntityOutputId |
Public Member Functions | |
| const PivotPhysicsState * | getPivotState (const CscWorldElementId &entityId, int id) const |
| const PropellerPhysicsState * | getPropellerState (const CscWorldElementId &entityId, int id) const |
| const WheelPhysicsState * | getWheelState (const CscWorldElementId &entityId, int id) const |
| const TranslationPhysicsState * | getTranslationState (const CscWorldElementId &entityId, int id) const |
| CscPhysicsSimulator (bool integratedPhysicsThread, float simulatorSpeed=1.0) | |
| virtual | ~CscPhysicsSimulator () |
| void | initFloor () |
| void | removeFloor () |
| void | setFloorRotation (float yaw, float pitch, float roll) |
| void | setFloorFriction (float val) |
| bool | isEntityPhysicsStateReady (const CscWorldElementId &entityId) |
| void | setEntityPhysicsInitDone (const CscWorldElementId &entityId) |
| bool | isEntityPhysicsStateLoaded (const CscWorldElementId &entityId) |
| void | importEntity (const CscWorldEntity *entity, const CscPoint3dOriented *customPositionAndOrientation=nullptr, bool requiresExternalInit=false) |
| void | importObjectIntoPhysicsSimulator (CscWorldObject *object) |
| void | importPlaceIntoPhysicsSimulator (CscWorldPlace *place) |
| void | importObjectsIntoPhysicsSimulator (vector< CscWorldObject * > *objects) |
| void | updateTranslation (const CscWorldElementId &entityId, int translationId, float val, bool relativeValues=false) |
| void | updateWheel (const CscWorldElementId &entityId, int wheelId, float val, float cst=1000.0, float speedCoef=1.0) |
| void | updateWheels (const CscWorldElementId &entityId, float val) |
| void | updatePropeller (const CscWorldElementId &entityId, int propellerId, float val, float cst=1000.0) |
| void | updatePivot (const CscWorldElementId &entityId, int pivotId, float newValPercent, bool relativeValues=false) |
| void | forceMemberValuesAndVerifyState (const CscWorldElementId &entityId, const CscMemberInputStatus *inputsValues, const bool applyPosition[3], const bool applyEuler[3], const bool applyAcceleration[3], optional< int > nbMaxIteration={}, optional< int > maxLoopDurationMillis={}, const CscState *verifyState=nullptr) |
| int | moveMemberToStateFromMember (const CscWorldElementId &entityId, const CscMemberInputStatus *inputsValues, const bool applyPosition[3], const bool applyEuler[3], const bool applyAcceleration[3], optional< int > nbMaxIteration={}, optional< int > maxLoopDurationMillis={}, int tryNumber=0) |
| void | moveMember (const CscWorldElementId &entityId, float *vals, int bodyIndex, int isTranslate) |
| void | memberTeleportToOrigin (const CscWorldElementId &entityId, int bodyIndex, float posX, float posY, float posZ) |
| void | memberTeleportToRotation (const CscWorldElementId &entityId, int bodyIndex, float yaw, float pitch, float roll) |
| void | memberTeleportToPositionAndAngle (const CscWorldElementId &entityId, int memberId, const CscPoint3dOriented *target, bool resetOutputsToInitialVals=false, optional< int > nbMaxIteration={}, optional< int > maxLoopDurationMillis={}, bool callPlayStateListener=false) |
| void | entityTeleport (const CscWorldElementId &entityId, const CscPoint3dOriented *target) |
| void | forceState (const CscWorldElementId &entityId, const CscState *appliedState, int memberIdForInputs, const bool applyPos[3], const bool applyRot[3], const bool applyAcc[3], optional< int > nbMaxIteration={}, optional< int > maxLoopDurationMillis={}, bool callPlayStateListener=false) |
| void | playSequence (const CscWorldElementId &entityId, CscState *init, CscSequence *sequence, const map< int, CscPivotMovementType > &pivotMovementByPivotId, bool geneticAi=false, bool extrapolationRealTime=false) |
| void | updateMemberPhysics (const CscWorldElementId &entityId, int itemId, float mass, float friction, float restitution, float linearDamping, float angularDamping) |
| void | updatePivotPhysics (const CscWorldElementId &entityId, int id, float min, float max, float softness, float bias, float relaxation, float speedMax, float percentSpeedMax) |
| void | updatePropellerPhysics (const CscWorldElementId &entityId, int id, float speedMax) |
| void | updateWheelMaxSpeed (const CscWorldElementId &entityId, int wheelId, float newSpeedMax) |
| void | updateTranslationPhysics (const CscWorldElementId &entityId, int translationId, float newMaxSpped) |
| void | updateBehaviorMode (const CscWorldElementId &entityId, int modeId, int memberId) |
| void | updateMemberEulers (const CscWorldElementId &entityId, int memberId, double eulerX, double eulerY, double eulerZ) |
| void | updateMemberPosition (const CscWorldElementId &entityId, int memberId, float posX, float posY, float posZ) |
| void | updatePivotSpeedMax (const CscWorldElementId &entityId, int id, float speedMax) |
| void | disableMembersCollisions (const CscWorldElementId &entityId) |
| void | enableMembersCollisions (const CscWorldElementId &entityId) |
| bool | hadEntityReachedState (const CscWorldElementId &entityId, const CscState *objectiveState, float epsilon) |
| float | getJointHingeAngle (const CscWorldElementId &entityId, int jointIdIn) const |
| vector< const CscMemberInputStatus * > * | getCurrentInputs (const CscWorldElementId &entityId) |
| virtual CscState * | getCurrentState (const CscWorldElementId &entityId) |
| CscState * | fillStateInputs (const CscWorldElementId &entityId, const CscState *incompleteState) |
| void | stepSimulationRealTime () |
| void | stepSimulationFutureVision (int millisecondsFromNow, int nbSubSteps=55) |
| void | setGravity (float xIn, float yIn, float zIn) |
| void | setEntityGravity (const CscWorldElementId &entityId, float xIn, float yIn, float zIn) |
| const CscWorldObject * | getObjectByIndex (int index) const |
| void | setOnStatePlayedListener (PlayStateListener onStatePlayedListener) |
| void | setSimulatorSpeed (float speed) |
| void | setState (const CscWorldElementId &entityId, CscState *state, bool relativeValues=false, int duration=200) |
| void | playState (const CscWorldElementId &entityId, CscState *state, int duration=0, int delay=0, bool relativeValues=false) |
| void | moveObjectToPosition (CscWorldElement *object, const CscPoint3d *targetPosition) |
| void | moveObjectToRotation (CscWorldElement *object, const CscPoint3d *targetRotation) |
| void | moveObjectToPositionAndRotation (CscWorldElement *object, const CscPoint3d *targetPosition, const CscPoint3d *targetRotation) |
| vector< CscPoint3d * > * | getEnvObjectShapesVertex (CscWorldElementId objectId) |
| int | getEnvObjectShapesVertexCount (CscWorldElementId objectId) |
| void | removeEntity (const CscWorldElementId &entityId) |
| void | clearPlaces () |
| void | clearObjects () |
| void | removeConscienceMemberFrontFocus () |
| CscPoint3dOriented * | getFocusBarPoint () |
| CscPoint3dOriented * | getFocusSpherePoint () |
| void | focusVisionIntoPosition (float posX, float posY, float posZ) |
| void | setAllPivotsToRelaxedMode (const CscWorldElementId &entityId) |
| void | setAllPivotsMotorDisabled (const CscWorldElementId &entityId, bool enabled) |
| void | unitUpdatePivots () |
| void | unitUpdateTranslations () |
| void | removeObjectById (CscWorldElementId objectId) |
| void | removeObjectByName (string name) |
| void | removePlaceById (string placeId) |
| vector< CscPoint3d * > | performRayScale (const CscPoint3d *position, const vector< const CscPoint3d * > &rayEnds, optional< int > collisionFilterGroup={COL_ENV_PLACE|COL_FLOOR|COL_ROBOT_MEMBERS|COL_ENV_OBJ}, optional< int > collisionFilterMask={COL_ENV_PLACE|COL_FLOOR|COL_ENV_OBJ}) |
| float | getPivotLimitMin (const CscWorldElementId &entityId, int pivotId) const |
| float | getPivotLimitMax (const CscWorldElementId &entityId, int pivotId) const |
| const MemberState * | getMemberStateById (const CscWorldElementId &entityId, int id) const |
| const MemberState * | getMemberState (const CscWorldElementId &entityId, const CscMember *member) const |
| const MemberState * | getMemberStateByName (const CscWorldElementId &entityId, const string &memberName) const |
| string | getPivotOtherMember (const CscWorldElementId &entityId, const string &memberName) |
| vector< CscState * > | dividingOneStateIntoSubStates (CscState *stateToDivide, CscState *currentState, int durationStateToDivide, int nbStateToDivide, float durationLastSubStep, const map< int, CscPivotMovementType > &pivotMovementByPivotId) |
| Divides a given state into multiple sub-states based on the specified duration and number of states to divide. More... | |
| CscSequence * | dividingAllStatesOfOneSequenceIntoSubStates (CscSequence *sequenceToDivide, CscState *initialState, const map< int, CscPivotMovementType > &pivotMovementByPivotId) |
| Divides all states in a given sequence into sub-states. More... | |
| map< int, CscPoint3d * > | getCenterOfMassOfAllMemberByMemberId (const CscWorldElementId &entityId) |
| CscPoint3d * | findCenterOfMass (const CscEntityModel *entityModel, map< int, CscPoint3d * > centerOfMassOfAllMemberByMemberId) |
| Computes the center of mass for a given entity model using member mass centers. More... | |
Public Attributes | |
| const unsigned long long | id |
| btDiscreteDynamicsWorld * | m_dynamicsWorld = nullptr |
| float | precisionGyro |
| int | precisionAction |
| bool | integratedPhysicsThread |
| long | curTimeInMicroseconds |
| long | prevTimeInMicroseconds |
| float | simulatorSpeed |
| btClock | clock |
| const float | fixedTimeStep = 1.0 / 100.0 |
| const float | minFPS = 16.6666666666f |
| btFixedConstraint * | visionCnt1 = NULL |
| btHingeConstraint * | visionCnt2 = NULL |
Protected Member Functions | |
| btRigidBody * | localCreateElasticBody (btScalar mass, const btTransform &startTransform, btCollisionShape *shape) |
| btRigidBody * | localCreateRigidBody (btScalar mass, const btTransform &startTransform, btCollisionShape *shape) |
| void | setMemberKinematicMode (const CscWorldElementId &entityId, int memberId, bool kinematicMode) |
| void | memberApplyAcceleration (const CscWorldElementId &entityId, int bodyIndex, float accX, float accY, float accZ) |
| void | clearAllForces (const CscWorldElementId &entityId) |
| void | activateEntityPhysics (const CscWorldElementId &entityId) |
| bool | samePosition (float x1, float y1, float z1, float x2, float y2, float z2, float epsilon) |
| bool | sameEuler (float yaw1, float pitch1, float roll1, float yaw2, float pitch2, float roll2, float epsilon) |
| bool | allMembersImmobile (const CscWorldElementId &entityId, float epsilon) |
| map< int, float > | getCurrentPropellers () |
| map< int, float > | getCurrentWheels () |
| map< int, float > | getCurrentTranslations () |
| map< int, float > | getCurrentJoints () |
| string | toDebugLogMemberInputs (const CscWorldElementId &entityId, int memberIndex) |
| void | removeAndDeleteBody (btRigidBody *) |
| void | removeObjectByIndex (int index) |
| void | fireStatePlayed (const CscWorldElementId &entityId, const CscState *state, int duration=0, int delay=0, bool relativeValues=false) |
Static Protected Member Functions | |
| static CscMemberPhysicsModelingType | definePhysicsModelingType (const CscMember *member) |
| static void | buildConvexHull (CscWorldElement *object) |
| static void | buildConcaveHull (CscWorldElement *object, float alphaShapeValue) |
Protected Attributes | |
| float | floorWidth = 6000.0 |
| float | floorHeight = 25.4 |
| float | floorLength = 6000.0 |
| float | globalGravity = -9.81 |
| btBroadphaseInterface * | m_broadphase |
| btCollisionDispatcher * | m_dispatcher |
| btDefaultCollisionConfiguration * | m_collisionConfiguration |
| btSequentialImpulseConstraintSolver * | m_solver |
| thread * | simulatorPhysicsThread = nullptr |
| bool | simulatorPhysicsThreadRunning = false |
| bool | simulatorPhysicsThreadStopped = true |
| btRigidBody * | floorBody = nullptr |
| map< CscWorldElementId, CscEntityPhysicsState * > | entities |
| map< CscWorldElementId, btRigidBody * > | placeBodies |
| vector< CscWorldObject * > | environmentObjects |
| map< CscWorldElementId, btRigidBody * > | otherBodies |
| map< CscWorldElementId, btCollisionShape * > | otherShapes |
| btRigidBody * | focusSphereBody = nullptr |
| btRigidBody * | focusBarBody = nullptr |
| float | speedFactor = 1.0 |
| std::unique_ptr< CscLogger > | logger |
| recursive_mutex | simulatorMutex |
| optional< PlayStateListener > | onStatePlayedListener = {} |
| conscience_core::simulator::CscPhysicsSimulator::CscPhysicsSimulator | ( | bool | integratedPhysicsThread, |
| float | simulatorSpeed = 1.0 |
||
| ) |
|
virtual |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::clearObjects | ( | ) |
| void conscience_core::simulator::CscPhysicsSimulator::clearPlaces | ( | ) |
|
staticprotected |
| void conscience_core::simulator::CscPhysicsSimulator::disableMembersCollisions | ( | const CscWorldElementId & | entityId | ) |
| CscSequence * conscience_core::simulator::CscPhysicsSimulator::dividingAllStatesOfOneSequenceIntoSubStates | ( | CscSequence * | sequenceToDivide, |
| CscState * | initialState, | ||
| const map< int, CscPivotMovementType > & | pivotMovementByPivotId | ||
| ) |
Divides all states in a given sequence into sub-states.
This function takes a sequence of states and for each state, divides it into multiple sub-states using the dividingOneStateIntoSubStates method. This is done for each state in the sequence, using a specified initial state and the physics state of a specific entity.
The function also calculates the duration of each sub-state by dividing the total duration of each state by the number of sub-states created for that state. The resulting sequence includes all the generated sub-states, each associated with its calculated duration.
| sequenceToDivide | Pointer to the sequence whose states are to be divided into sub-states. |
| initialState | Pointer to the initial state to use when dividing the first state in the sequence. |
| pivotMovementByPivotId | Map wich associating each pivot to a type of movement. |
Note: This function allocates new memory for the sequence and the sub-states, so it is the caller's responsibility to manage the allocated memory.
| vector< CscState * > conscience_core::simulator::CscPhysicsSimulator::dividingOneStateIntoSubStates | ( | CscState * | stateToDivide, |
| CscState * | currentState, | ||
| int | durationStateToDivide, | ||
| int | nbStateToDivide, | ||
| float | durationLastSubStep, | ||
| const map< int, CscPivotMovementType > & | pivotMovementByPivotId | ||
| ) |
Divides a given state into multiple sub-states based on the specified duration and number of states to divide.
This method generates a series of intermediate states between the current state and the target state. Each intermediate state corresponds to a sub-duration of the total transition duration. The method considers the type of movement (either Constant or Sinusoidal) of each pivot in the physics state of a specified entity.
If the movement type is Constant, the target value of the pivot for a sub-state is linearly interpolated between the current value and the target value.
If the movement type is Sinusoidal, the target value of the pivot for a sub-state is calculated as a sinusoidal function of time, with the amplitude equal to half of the total angle change and the offset equal to the average of the current and target values.
| stateToDivide | The target state to divide into sub-states. |
| currentState | The current state from which to start the division. |
| durationStateToDivide | The total duration of the transition from the current state to the target state. |
| nbStateToDivide | The number of sub-states into which to divide the target state. |
| durationLastSubStep | The duration of the last subStep. |
| pivotMovementByPivotId | Map wich associating each pivot to a type of movement. |
| void conscience_core::simulator::CscPhysicsSimulator::enableMembersCollisions | ( | const CscWorldElementId & | entityId | ) |
| void conscience_core::simulator::CscPhysicsSimulator::entityTeleport | ( | const CscWorldElementId & | entityId, |
| const CscPoint3dOriented * | target | ||
| ) |
Teleports an entity to given position and orientation
| CscState * conscience_core::simulator::CscPhysicsSimulator::fillStateInputs | ( | const CscWorldElementId & | entityId, |
| const CscState * | incompleteState | ||
| ) |
Warning: this forces given state into current simulator, and returns a NEW state with inputs filled
| CscPoint3d * conscience_core::simulator::CscPhysicsSimulator::findCenterOfMass | ( | const CscEntityModel * | entityModel, |
| map< int, CscPoint3d * > | centerOfMassOfAllMemberByMemberId | ||
| ) |
Computes the center of mass for a given entity model using member mass centers.
This function calculates the center of mass for an entity model. It iterates through the provided map of member IDs and their corresponding mass centers, computes a weighted sum of member mass centers based on the mass of each member, and finally divides by the total mass to determine the center of mass for the entire entity.
| entityModel | Pointer to the entity model that contains the mass data of each member. |
| centerOfMassOfAllMemberByMemberId | A map of member IDs to their respective mass center positions (as CscPoint3d pointers). |
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::focusVisionIntoPosition | ( | float | posX, |
| float | posY, | ||
| float | posZ | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::forceMemberValuesAndVerifyState | ( | const CscWorldElementId & | entityId, |
| const CscMemberInputStatus * | inputsValues, | ||
| const bool | applyPosition[3], | ||
| const bool | applyEuler[3], | ||
| const bool | applyAcceleration[3], | ||
| optional< int > | nbMaxIteration = {}, |
||
| optional< int > | maxLoopDurationMillis = {}, |
||
| const CscState * | verifyState = nullptr |
||
| ) |
| nbMaxIteration | maximum number of iteration for main loop which can take a long time before convergence |
| maxLoopDurationMillis | maximum duration for main loop which can take a long time before convergence |
| void conscience_core::simulator::CscPhysicsSimulator::forceState | ( | const CscWorldElementId & | entityId, |
| const CscState * | appliedState, | ||
| int | memberIdForInputs, | ||
| const bool | applyPos[3], | ||
| const bool | applyRot[3], | ||
| const bool | applyAcc[3], | ||
| optional< int > | nbMaxIteration = {}, |
||
| optional< int > | maxLoopDurationMillis = {}, |
||
| bool | callPlayStateListener = false |
||
| ) |
| nbMaxIteration | maximum number of iteration for forceMemberValuesAndVerifyState loop which can take a long time before convergence |
| maxLoopDurationMillis | maximum duration for forceMemberValuesAndVerifyState loop which can take a long time before convergence |
| map< int, CscPoint3d * > conscience_core::simulator::CscPhysicsSimulator::getCenterOfMassOfAllMemberByMemberId | ( | const CscWorldElementId & | entityId | ) |
| vector< const CscMemberInputStatus * > * conscience_core::simulator::CscPhysicsSimulator::getCurrentInputs | ( | const CscWorldElementId & | entityId | ) |
|
protected |
|
protected |
|
virtual |
return requested entity's current state WARNING: a NEW state is returned, which means pointer needs to be deleted after usage
|
protected |
|
protected |
| vector< CscPoint3d * > * conscience_core::simulator::CscPhysicsSimulator::getEnvObjectShapesVertex | ( | CscWorldElementId | objectId | ) |
| int conscience_core::simulator::CscPhysicsSimulator::getEnvObjectShapesVertexCount | ( | CscWorldElementId | objectId | ) |
| CscPoint3dOriented * conscience_core::simulator::CscPhysicsSimulator::getFocusBarPoint | ( | ) |
| CscPoint3dOriented * conscience_core::simulator::CscPhysicsSimulator::getFocusSpherePoint | ( | ) |
| float conscience_core::simulator::CscPhysicsSimulator::getJointHingeAngle | ( | const CscWorldElementId & | entityId, |
| int | jointIdIn | ||
| ) | const |
| const CscPhysicsSimulator::MemberState * conscience_core::simulator::CscPhysicsSimulator::getMemberState | ( | const CscWorldElementId & | entityId, |
| const CscMember * | member | ||
| ) | const |
| const CscPhysicsSimulator::MemberState * conscience_core::simulator::CscPhysicsSimulator::getMemberStateById | ( | const CscWorldElementId & | entityId, |
| int | id | ||
| ) | const |
| const CscPhysicsSimulator::MemberState * conscience_core::simulator::CscPhysicsSimulator::getMemberStateByName | ( | const CscWorldElementId & | entityId, |
| const string & | memberName | ||
| ) | const |
|
inline |
| float conscience_core::simulator::CscPhysicsSimulator::getPivotLimitMax | ( | const CscWorldElementId & | entityId, |
| int | pivotId | ||
| ) | const |
| float conscience_core::simulator::CscPhysicsSimulator::getPivotLimitMin | ( | const CscWorldElementId & | entityId, |
| int | pivotId | ||
| ) | const |
| string conscience_core::simulator::CscPhysicsSimulator::getPivotOtherMember | ( | const CscWorldElementId & | entityId, |
| const string & | memberName | ||
| ) |
Return other member name attached by a pivot to member having name in parameter
| const CscPhysicsSimulator::PivotPhysicsState * conscience_core::simulator::CscPhysicsSimulator::getPivotState | ( | const CscWorldElementId & | entityId, |
| int | id | ||
| ) | const |
| const CscPhysicsSimulator::PropellerPhysicsState * conscience_core::simulator::CscPhysicsSimulator::getPropellerState | ( | const CscWorldElementId & | entityId, |
| int | id | ||
| ) | const |
| const CscPhysicsSimulator::TranslationPhysicsState * conscience_core::simulator::CscPhysicsSimulator::getTranslationState | ( | const CscWorldElementId & | entityId, |
| int | id | ||
| ) | const |
| const CscPhysicsSimulator::WheelPhysicsState * conscience_core::simulator::CscPhysicsSimulator::getWheelState | ( | const CscWorldElementId & | entityId, |
| int | id | ||
| ) | const |
| bool conscience_core::simulator::CscPhysicsSimulator::hadEntityReachedState | ( | const CscWorldElementId & | entityId, |
| const CscState * | objectiveState, | ||
| float | epsilon | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::importEntity | ( | const CscWorldEntity * | entity, |
| const CscPoint3dOriented * | customPositionAndOrientation = nullptr, |
||
| bool | requiresExternalInit = false |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::importObjectIntoPhysicsSimulator | ( | CscWorldObject * | object | ) |
| void conscience_core::simulator::CscPhysicsSimulator::importObjectsIntoPhysicsSimulator | ( | vector< CscWorldObject * > * | objects | ) |
| void conscience_core::simulator::CscPhysicsSimulator::importPlaceIntoPhysicsSimulator | ( | CscWorldPlace * | place | ) |
| void conscience_core::simulator::CscPhysicsSimulator::initFloor | ( | ) |
| bool conscience_core::simulator::CscPhysicsSimulator::isEntityPhysicsStateLoaded | ( | const CscWorldElementId & | entityId | ) |
entity physics state and ready when it received its first refresh from physics simulator
| bool conscience_core::simulator::CscPhysicsSimulator::isEntityPhysicsStateReady | ( | const CscWorldElementId & | entityId | ) |
entity physics state and ready when it received its first refresh from physics simulator AND fully initialized (please see CscEntityReflexionParameters physicsRequiresAdditionalInit param)
|
protected |
|
protected |
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::memberTeleportToOrigin | ( | const CscWorldElementId & | entityId, |
| int | bodyIndex, | ||
| float | posX, | ||
| float | posY, | ||
| float | posZ | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::memberTeleportToPositionAndAngle | ( | const CscWorldElementId & | entityId, |
| int | memberId, | ||
| const CscPoint3dOriented * | target, | ||
| bool | resetOutputsToInitialVals = false, |
||
| optional< int > | nbMaxIteration = {}, |
||
| optional< int > | maxLoopDurationMillis = {}, |
||
| bool | callPlayStateListener = false |
||
| ) |
| nbMaxIteration | maximum number of iteration for forceMemberValuesAndVerifyState loop which can take a long time before convergence |
| maxLoopDurationMillis | maximum duration for forceMemberValuesAndVerifyState loop which can take a long time before convergence |
| void conscience_core::simulator::CscPhysicsSimulator::memberTeleportToRotation | ( | const CscWorldElementId & | entityId, |
| int | bodyIndex, | ||
| float | yaw, | ||
| float | pitch, | ||
| float | roll | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::moveMember | ( | const CscWorldElementId & | entityId, |
| float * | vals, | ||
| int | bodyIndex, | ||
| int | isTranslate | ||
| ) |
| int conscience_core::simulator::CscPhysicsSimulator::moveMemberToStateFromMember | ( | const CscWorldElementId & | entityId, |
| const CscMemberInputStatus * | inputsValues, | ||
| const bool | applyPosition[3], | ||
| const bool | applyEuler[3], | ||
| const bool | applyAcceleration[3], | ||
| optional< int > | nbMaxIteration = {}, |
||
| optional< int > | maxLoopDurationMillis = {}, |
||
| int | tryNumber = 0 |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::moveObjectToPosition | ( | CscWorldElement * | object, |
| const CscPoint3d * | targetPosition | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::moveObjectToPositionAndRotation | ( | CscWorldElement * | object, |
| const CscPoint3d * | targetPosition, | ||
| const CscPoint3d * | targetRotation | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::moveObjectToRotation | ( | CscWorldElement * | object, |
| const CscPoint3d * | targetRotation | ||
| ) |
| vector< CscPoint3d * > conscience_core::simulator::CscPhysicsSimulator::performRayScale | ( | const CscPoint3d * | position, |
| const vector< const CscPoint3d * > & | rayEnds, | ||
| optional< int > | collisionFilterGroup = {COL_ENV_PLACE | COL_FLOOR | COL_ROBOT_MEMBERS | COL_ENV_OBJ}, |
||
| optional< int > | collisionFilterMask = {COL_ENV_PLACE | COL_FLOOR | COL_ENV_OBJ} |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::playSequence | ( | const CscWorldElementId & | entityId, |
| CscState * | init, | ||
| CscSequence * | sequence, | ||
| const map< int, CscPivotMovementType > & | pivotMovementByPivotId, | ||
| bool | geneticAi = false, |
||
| bool | extrapolationRealTime = false |
||
| ) |
| isGeneticAi | is use to know if method is called by a genetic algorityhm, in this case, we need to perform some "stepSimulationFutureVision" to make sure that we can't have residual forces on entity |
| extrapolationRealTime | is use to play a sequence with its extrapolation in real time instead futureVision |
| void conscience_core::simulator::CscPhysicsSimulator::playState | ( | const CscWorldElementId & | entityId, |
| CscState * | state, | ||
| int | duration = 0, |
||
| int | delay = 0, |
||
| bool | relativeValues = false |
||
| ) |
Plays an entity's state in this simulator. This is the normal way of requesting a state for an entity. This will set state fully, and call listener
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::removeConscienceMemberFrontFocus | ( | ) |
| void conscience_core::simulator::CscPhysicsSimulator::removeEntity | ( | const CscWorldElementId & | entityId | ) |
| void conscience_core::simulator::CscPhysicsSimulator::removeFloor | ( | ) |
| void conscience_core::simulator::CscPhysicsSimulator::removeObjectById | ( | CscWorldElementId | objectId | ) |
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::removeObjectByName | ( | string | name | ) |
| void conscience_core::simulator::CscPhysicsSimulator::removePlaceById | ( | string | placeId | ) |
|
protected |
|
protected |
| void conscience_core::simulator::CscPhysicsSimulator::setAllPivotsMotorDisabled | ( | const CscWorldElementId & | entityId, |
| bool | enabled | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::setAllPivotsToRelaxedMode | ( | const CscWorldElementId & | entityId | ) |
| void conscience_core::simulator::CscPhysicsSimulator::setEntityGravity | ( | const CscWorldElementId & | entityId, |
| float | xIn, | ||
| float | yIn, | ||
| float | zIn | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::setEntityPhysicsInitDone | ( | const CscWorldElementId & | entityId | ) |
| void conscience_core::simulator::CscPhysicsSimulator::setFloorFriction | ( | float | val | ) |
| void conscience_core::simulator::CscPhysicsSimulator::setFloorRotation | ( | float | yaw, |
| float | pitch, | ||
| float | roll | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::setGravity | ( | float | xIn, |
| float | yIn, | ||
| float | zIn | ||
| ) |
|
protected |
|
inline |
|
inline |
| void conscience_core::simulator::CscPhysicsSimulator::setState | ( | const CscWorldElementId & | entityId, |
| CscState * | state, | ||
| bool | relativeValues = false, |
||
| int | duration = 200 |
||
| ) |
Forces entity's state in this simulator. No listener will be called
| void conscience_core::simulator::CscPhysicsSimulator::stepSimulationFutureVision | ( | int | millisecondsFromNow, |
| int | nbSubSteps = 55 |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::stepSimulationRealTime | ( | ) |
|
inlineprotected |
| void conscience_core::simulator::CscPhysicsSimulator::unitUpdatePivots | ( | ) |
| void conscience_core::simulator::CscPhysicsSimulator::unitUpdateTranslations | ( | ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateBehaviorMode | ( | const CscWorldElementId & | entityId, |
| int | modeId, | ||
| int | memberId | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateMemberEulers | ( | const CscWorldElementId & | entityId, |
| int | memberId, | ||
| double | eulerX, | ||
| double | eulerY, | ||
| double | eulerZ | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateMemberPhysics | ( | const CscWorldElementId & | entityId, |
| int | itemId, | ||
| float | mass, | ||
| float | friction, | ||
| float | restitution, | ||
| float | linearDamping, | ||
| float | angularDamping | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateMemberPosition | ( | const CscWorldElementId & | entityId, |
| int | memberId, | ||
| float | posX, | ||
| float | posY, | ||
| float | posZ | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updatePivot | ( | const CscWorldElementId & | entityId, |
| int | pivotId, | ||
| float | newValPercent, | ||
| bool | relativeValues = false |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updatePivotPhysics | ( | const CscWorldElementId & | entityId, |
| int | id, | ||
| float | min, | ||
| float | max, | ||
| float | softness, | ||
| float | bias, | ||
| float | relaxation, | ||
| float | speedMax, | ||
| float | percentSpeedMax | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updatePivotSpeedMax | ( | const CscWorldElementId & | entityId, |
| int | id, | ||
| float | speedMax | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updatePropeller | ( | const CscWorldElementId & | entityId, |
| int | propellerId, | ||
| float | val, | ||
| float | cst = 1000.0 |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updatePropellerPhysics | ( | const CscWorldElementId & | entityId, |
| int | id, | ||
| float | speedMax | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateTranslation | ( | const CscWorldElementId & | entityId, |
| int | translationId, | ||
| float | val, | ||
| bool | relativeValues = false |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateTranslationPhysics | ( | const CscWorldElementId & | entityId, |
| int | translationId, | ||
| float | newMaxSpped | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateWheel | ( | const CscWorldElementId & | entityId, |
| int | wheelId, | ||
| float | val, | ||
| float | cst = 1000.0, |
||
| float | speedCoef = 1.0 |
||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateWheelMaxSpeed | ( | const CscWorldElementId & | entityId, |
| int | wheelId, | ||
| float | newSpeedMax | ||
| ) |
| void conscience_core::simulator::CscPhysicsSimulator::updateWheels | ( | const CscWorldElementId & | entityId, |
| float | val | ||
| ) |
| btClock conscience_core::simulator::CscPhysicsSimulator::clock |
| long conscience_core::simulator::CscPhysicsSimulator::curTimeInMicroseconds |
|
protected |
|
protected |
| const float conscience_core::simulator::CscPhysicsSimulator::fixedTimeStep = 1.0 / 100.0 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| const unsigned long long conscience_core::simulator::CscPhysicsSimulator::id |
| bool conscience_core::simulator::CscPhysicsSimulator::integratedPhysicsThread |
|
protected |
|
protected |
|
protected |
|
protected |
| btDiscreteDynamicsWorld* conscience_core::simulator::CscPhysicsSimulator::m_dynamicsWorld = nullptr |
|
protected |
| const float conscience_core::simulator::CscPhysicsSimulator::minFPS = 16.6666666666f |
|
protected |
|
protected |
|
protected |
|
protected |
| int conscience_core::simulator::CscPhysicsSimulator::precisionAction |
| float conscience_core::simulator::CscPhysicsSimulator::precisionGyro |
| long conscience_core::simulator::CscPhysicsSimulator::prevTimeInMicroseconds |
|
protected |
|
protected |
|
protected |
|
protected |
| float conscience_core::simulator::CscPhysicsSimulator::simulatorSpeed |
|
protected |
| btFixedConstraint* conscience_core::simulator::CscPhysicsSimulator::visionCnt1 = NULL |
| btHingeConstraint* conscience_core::simulator::CscPhysicsSimulator::visionCnt2 = NULL |