17 #ifndef ROLLINGMOVEMENTLOGIC_H
18 #define ROLLINGMOVEMENTLOGIC_H
20 #include <Box2D/Box2D.h>
21 #include <Engine/Logic.h>
188 virtual void update()
override;
226 class RayCastCallbackHelper;
231 float mProximityRadius = 0.6f;
232 b2Vec2 mGroundNormal = b2Vec2(0.0f, 0.0f);
233 b2Vec2 mMagnetismInfluence = b2Vec2(0.0f, 0.0f);
234 float mAntiGravityAmount = 0.3f;
235 float mTurnBoost = 2.0f;
236 float mTorqueForceRatio = 2.0f;
237 float mSpeedFalloffRatio = 0.5f;
239 static const Ray PROXIMITY_TEST_RAYS[];
240 static const int PROXIMITY_TEST_RAY_COUNT;
244 #endif // ROLLINGMOVEMENTLOGIC_H
QPointF magnetismInfluence
Direction to the magnetic object this actor is magnetizing to, or a zero vector if there is currently...
Definition: RollingMovementLogic.h:65
void setTorqueForceRatio(float value)
Sets torqueForceRatio.
QPointF getDirection() const
Returns direction.
Definition: RollingMovementLogic.h:107
float getTorqueForceRatio() const
Returns torqueForceRatio.
Definition: RollingMovementLogic.h:161
void setAntiGravityAmount(float value)
Sets antiGravityAmount.
Q_INVOKABLE QPointF getGroundNormal() const
Returns the current "up" direction used to orient movement.
void proximityRadiusChanged()
Emitted when proximityRadius changes.
void setDirection(const QPointF &value)
Sets direction.
void turnBoostChanged()
Emitted when turnBoost changes.
Logic which exerts force in a specified direction, causing the actor to roll in that direction...
Definition: RollingMovementLogic.h:48
void speedFalloffRatioChanged()
Emitted when speedFalloffRatio changes.
void setSpeedFalloffRatio(float value)
Sets speedFalloffRatio.
void setTurnBoost(float value)
Sets turnBoost.
float getAntiGravityAmount() const
Returns antiGravityAmount.
Definition: RollingMovementLogic.h:143
QPointF direction
Direction the actor should move in.
Definition: RollingMovementLogic.h:56
float torqueForceRatio
Balance of torque to linear force.
Definition: RollingMovementLogic.h:94
float getSpeed() const
Returns speed.
Definition: RollingMovementLogic.h:125
Non-visual entities in the QML item tree that define behavior for their parent Actor.
Definition: Logic.h:31
void torqueForceRatioChanged()
Emitted when torqueForceRatio changes.
QPointF getMagnetismInfluence() const
Returns magnetismInfluence.
float turnBoost
Extra force multiplier applied when turning.
Definition: RollingMovementLogic.h:89
float antiGravityAmount
Amount of force the actor can exert against gravity, as a percentage from 0.0f to 1...
Definition: RollingMovementLogic.h:85
float getTurnBoost() const
Returns turnBoost.
Definition: RollingMovementLogic.h:152
void magnetismInfluenceChanged()
Emitted when magnetismInfluence changes.
void speedChanged()
Emitted when speed changes.
float speed
Speed the actor accelerates at.
Definition: RollingMovementLogic.h:71
void setMagnetismInfluence(const QPointF &value)
Sets magnetismInfluence.
virtual void update() override
Computes and applys torque and linear forces on this actor's Body.
void directionChanged()
Emitted when direction changes.
float proximityRadius
Distance that the actor will sense other bodies to use as orientation references. ...
Definition: RollingMovementLogic.h:76
float getSpeedFalloffRatio() const
Returns speedFalloffRatio.
Definition: RollingMovementLogic.h:170
float getProximityRadius() const
Returns proximityRadius.
Definition: RollingMovementLogic.h:134
void antiGravityAmountChanged()
Emitted when antiGravityAmount changes.
void setProximityRadius(float value)
Sets proximityRadius.
float speedFalloffRatio
Amount of falloff at higher speeds.
Definition: RollingMovementLogic.h:101
void setSpeed(float value)
Sets speed.