|
QPlatformerBody * | SetMovingFloorSnapOffset (float value) |
| Sets the snap offset for moving floors. More...
|
|
float | GetMovingFloorSnapOffset () |
| Gets the snap offset for moving floors. More...
|
|
QPlatformerBody * | SetFloorMaxAngle (float value) |
| Sets the maximum angle for the floor. More...
|
|
float | GetFloorMaxAngle () |
| Gets the maximum angle for the floor. More...
|
|
QPlatformerBody * | SetFloorMaxAngleDegree (float value) |
| Sets the maximum angle for the floor in degrees. More...
|
|
float | GetFloorMaxAngleDegree () |
| Gets the maximum angle for the floor in degrees. More...
|
|
bool | GetIsOnFloor () |
| Checks if the body is currently on the floor. More...
|
|
bool | GetIsOnCeiling () |
| Checks if the body is currently touching the ceiling. More...
|
|
QPlatformerBody * | SetGravity (QVector value) |
| Sets the gravity vector. More...
|
|
QVector | GetGravity () |
| Gets the gravity vector. More...
|
|
QPlatformerBody * | SetGravityMultiplier (float value) |
| Sets the gravity multiplier. More...
|
|
float | GetGravityMultiplier () |
| Gets the gravity multiplier. More...
|
|
QPlatformerBody * | SetWalkSpeed (float value) |
| Sets the walking speed of the body. More...
|
|
float | GetWalkSpeed () |
| Gets the walking speed of the body. More...
|
|
QPlatformerBody * | SetWalkAcelerationRate (float value) |
| Sets the walking acceleration rate. More...
|
|
float | GetWalkAcelerationRate () |
| Gets the walking acceleration rate. More...
|
|
QPlatformerBody * | SetWalkDecelerationRate (float value) |
| Sets the walking deceleration rate. More...
|
|
float | GetWalkDecelerationRate () |
| Gets the walking deceleration rate. More...
|
|
QPlatformerBody * | Walk (int side) |
| Moves the body in a specified horizontal direction. More...
|
|
QPlatformerBody * | SetControllerHorizontalVelocity (QVector value) |
| Sets the horizontal velocity controlled by the character physics. More...
|
|
QVector | GetControllerHorizontalVelocity () |
| Gets the horizontal velocity controlled by the character physics. More...
|
|
QPlatformerBody * | SetControllerVerticalVelocity (QVector value) |
| Sets the vertical velocity controlled by the character physics. More...
|
|
QVector | GetControllerVerticalVelocity () |
| Gets the vertical velocity controlled by the character physics. More...
|
|
bool | GetIsFalling () |
| Checks if the body is falling. More...
|
|
bool | GetIsRising () |
| Checks if the body is rising. More...
|
|
QPlatformerBody * | SetJumpDurationFrameCount (int value) |
| Sets the duration for a jump in frames. More...
|
|
int | GetJumpDurationFrameCount () |
| Gets the duration for a jump in frames. More...
|
|
QPlatformerBody * | SetJumpGravityMultiplier (float value) |
| Sets the gravity multiplier during a jump. More...
|
|
float | GetJumpGravityMultiplier () |
| Gets the gravity multiplier during a jump. More...
|
|
QPlatformerBody * | SetJumpFallGravityMultiplier (float value) |
| Sets the gravity multiplier for the falling phase of a jump. More...
|
|
float | GetJumpFallGravityMultiplier () |
| Gets the gravity multiplier for the falling phase of a jump. More...
|
|
QPlatformerBody * | SetMaxJumpCount (int value) |
| Sets the maximum number of jumps allowed. More...
|
|
int | GetMaxJumpCount () |
| Gets the maximum number of jumps allowed. More...
|
|
QPlatformerBody * | Jump (float force, bool unconditional=false) |
| Initiates a jump with the specified force. More...
|
|
QPlatformerBody * | ReleaseJump () |
| Releases the jump phase. More...
|
|
bool | GetIsJumping () |
| Checks if the body is currently jumping. More...
|
|
bool | GetIsJumpReleased () |
| Checks if the jump phase has been released. More...
|
|
QPlatformerBody * | SetSpecificPlatformLayers (int layersBit) |
| Sets specific platform layers bit. This determines which platform layers the platformer physics will apply to, such as sloped surfaces, ceilings, walls, etc. The default value is 0, which disables this functionality. More...
|
|
int | GetSpecificPlatformLayers () |
| Gets specific platform layers bit. This determines which platform layers the platformer physics will apply to, such as sloped surfaces, ceilings, walls, etc. The default value is 0, which disables this functionality. More...
|
|
QPlatformerBody::CollisionTestInfo | GetPlatformCollisions (QVector testPosition, QVector nearestOnAxis=QVector::Zero()) |
| Performs a platform collision test. More...
|
|
QPlatformerBody::CollisionTestInfo | GetRightWall (float offset) |
| Checks for a collision with a wall on the right. More...
|
|
QPlatformerBody::CollisionTestInfo | GetLeftWall (float offset) |
| Checks for a collision with a wall on the left. More...
|
|
QPlatformerBody::CollisionTestInfo | GetFloor (float offset) |
| Checks for a collision with the floor. More...
|
|
QPlatformerBody::CollisionTestInfo | GetCeiling (float offset) |
| Checks for a collision with the ceiling. More...
|
|
Public Member Functions inherited from QRigidBody |
bool | GetFixedRotationEnabled () |
|
bool | GetKinematicEnabled () |
|
bool | GetKinematicCollisionsEnabled () |
|
QVector | GetForce () |
|
float | GetAngularForce () |
|
QRigidBody * | SetFixedRotationEnabled (bool value) |
|
QRigidBody * | SetKinematicEnabled (bool value) |
|
QRigidBody * | SetKinematicCollisionsEnabled (bool value) |
|
QRigidBody * | SetPositionAndCollide (QVector value, bool withPreviousPosition=true) |
|
QRigidBody * | ApplyForce (QVector force, QVector r, bool updateMeshTransforms=true) |
|
QRigidBody * | ApplyImpulse (QVector impulse, QVector r) |
|
QRigidBody * | SetForce (QVector value) |
|
QRigidBody * | AddForce (QVector value) |
|
QRigidBody * | SetAngularForce (float value) |
|
QRigidBody * | AddAngularForce (float value) |
|
virtual void | Update () |
|
Public Member Functions inherited from QBody |
virtual void | OnPreStep () |
|
virtual void | OnStep () |
|
virtual bool | OnCollision (CollisionInfo) |
|
BodyTypes | GetBodyType () |
|
QWorld * | GetWorld () |
|
QVector | GetPosition () |
|
QVector | GetPreviousPosition () |
|
float | GetRotation () |
|
float | GetRotationDegree () |
|
float | GetPreviousRotation () |
|
QAABB | GetAABB () const |
|
float | GetTotalInitialArea () |
|
float | GetTotalPolygonsInitialArea () |
|
float | GetTotalArea () |
|
float | GetTotalPolygonsArea () |
|
Modes | GetMode () |
|
float | GetInertia () |
|
int | GetLayersBit () |
|
int | GetCollidableLayersBit () |
|
bool | GetOverlapWithCollidableLayersBit (int layersBit) |
|
bool | GetOverlapWithLayersBit (int layersBit) |
|
bool | GetIsSleeping () |
|
bool | GetCanSleep () |
|
SimulationModels | GetSimulationModel () |
|
float | GetFriction () |
|
float | GetStaticFriction () |
|
float | GetAirFriction () |
|
virtual float | GetMass () |
|
float | GetRestitution () |
|
float | GetCircumference () |
|
bool | GetBodySpecificTimeScaleEnabled () |
|
float | GetBodySpesificTimeScale () |
|
bool | GetEnabled () |
|
float | GetVelocityLimit () |
|
bool | GetIntegratedVelocitiesEnabled () |
|
QBody * | SetPosition (QVector value, bool withPreviousPosition=true) |
|
QBody * | AddPosition (QVector value, bool withPreviousPosition=true) |
|
QBody * | SetPreviousPosition (QVector value) |
|
QBody * | AddPreviousPosition (QVector value) |
|
QBody * | SetRotation (float angleRadian, bool withPreviousRotation=true) |
|
QBody * | SetRotationDegree (float degree, bool withPreviousRotation=true) |
|
QBody * | AddRotation (float angleRadian, bool withPreviousRotation=true) |
|
QBody * | SetPreviousRotation (float angleRadian) |
|
QBody * | AddPreviousRotation (float angleRadian) |
|
QBody * | SetLayersBit (int value) |
|
QBody * | SetCollidableLayersBit (int value) |
|
QBody * | SetCanSleep (bool value) |
|
QBody * | SetMode (QBody::Modes bodyMode) |
|
QBody * | SetSimulationModel (SimulationModels model) |
|
QBody * | SetFriction (float value) |
|
QBody * | SetStaticFriction (float value) |
|
QBody * | SetAirFriction (float value) |
|
QBody * | SetMass (float value) |
|
QBody * | SetRestitution (float value) |
|
QBody * | SetBodySpecificTimeScaleEnabled (bool value) |
|
QBody * | SetBodySpecificTimeScale (float value) |
|
QBody * | SetEnabled (bool value) |
|
QBody * | SetIntegratedVelocitiesEnabled (bool value) |
|
QBody * | AddMesh (QMesh *mesh) |
|
QBody * | RemoveMeshAt (int index) |
|
QMesh * | GetMeshAt (int index) |
|
int | GetMeshCount () |
|
vector< QMesh * > * | GetMeshes () |
|
QBody * | AddMeshesFromFile (string filePath) |
|
QBody * | WakeUp () |
|
QBody * | SetVelocityLimit (float value) |
|
|
bool | onFloor =false |
|
bool | onCeiling =false |
|
int | platformLayersBit =0 |
|
float | maxFloorAngle =M_PI*0.25 |
|
float | movingFloorSnapOffset =10.0f |
|
QRigidBody * | lastMovableFloor =nullptr |
|
QVector | gravity =QVector(0,0.3) |
|
float | gravityMultiplier =1.0f |
|
QVector | velocity =QVector::Zero() |
|
QVector | upDirection =QVector::Up() |
|
QVector | rightDirection =QVector::Right() |
|
float | walkSpeed =3.0 |
|
QVector | horizontalVelocity =QVector::Zero() |
|
QVector | verticalVelocity =QVector::Zero() |
|
bool | isFalling =false |
|
bool | isRising =false |
|
int | walkSide =0 |
|
float | walkAccelerationRate =0.1f |
|
float | walkDecelerationRate =0.1f |
|
bool | prevJumpMode =false |
|
bool | jumpMode =false |
|
float | jumpForce =5.0f |
|
int | maxJumpCount =2 |
|
int | currentJumpCount =0 |
|
int | jumpDurationFrameCount =30 |
|
int | jumpFrameCountDown =0 |
|
float | jumpGravityMultiplier =0.4f |
|
float | jumpFallGravityMultiplier =1.0f |
|
bool | jumpReleased =true |
|
Protected Attributes inherited from QRigidBody |
float | angularForce =0.0f |
|
QVector | force =QVector::Zero() |
|
Protected Attributes inherited from QBody |
QWorld * | world |
|
QVector | position =QVector(0,0) |
|
QVector | prevPosition =QVector::Zero() |
|
float | rotation =0.0f |
|
float | prevRotation =0.0f |
|
QAABB | aabb |
|
Modes | mode =QBody::Modes::DYNAMIC |
|
bool | inertiaNeedsUpdate =true |
|
bool | circumferenceNeedsUpdate =true |
|
bool | enableBodySpecificTimeScale =false |
|
float | bodySpecificTimeScale =1.0f |
|
BodyTypes | bodyType =BodyTypes::RIGID |
|
bool | enabled =true |
|
float | velocityLimit =0.0f |
|
bool | enableIntegratedVelocities =true |
|
float | friction =0.2f |
|
float | staticFriction =0.5f |
|
float | airFriction =0.01f |
|
float | mass =1.0f |
|
float | restitution =0.0f |
|
int | layersBit =1 |
|
int | collidableLayersBit =1 |
|
bool | isKinematic =false |
|
bool | allowKinematicCollisions =false |
|
bool | isSleeping =false |
|
int | sleepTick =120 |
|
int | fixedVelocityTick =0 |
|
int | fixedAngularTick =0 |
|
bool | canSleep =true |
|
vector< QMesh * > | _meshes =vector<QMesh*>() |
|
SimulationModels | simulationModel =SimulationModels::RIGID_BODY |
|
QPlatformerBody provides a ready-to-use foundation for character physics in platformer games. It includes behaviors such as gravity, walking on slopes, and jumping. Additionally, it offers helper methods and properties for further customization.