|
QPointF | getDirection () const |
| Returns direction. More...
|
|
void | setDirection (const QPointF &value) |
| Sets direction. More...
|
|
QPointF | getMagnetismInfluence () const |
| Returns magnetismInfluence. More...
|
|
void | setMagnetismInfluence (const QPointF &value) |
| Sets magnetismInfluence. More...
|
|
float | getSpeed () const |
| Returns speed. More...
|
|
void | setSpeed (float value) |
| Sets speed. More...
|
|
float | getProximityRadius () const |
| Returns proximityRadius. More...
|
|
void | setProximityRadius (float value) |
| Sets proximityRadius. More...
|
|
float | getAntiGravityAmount () const |
| Returns antiGravityAmount. More...
|
|
void | setAntiGravityAmount (float value) |
| Sets antiGravityAmount. More...
|
|
float | getTurnBoost () const |
| Returns turnBoost. More...
|
|
void | setTurnBoost (float value) |
| Sets turnBoost. More...
|
|
float | getTorqueForceRatio () const |
| Returns torqueForceRatio. More...
|
|
void | setTorqueForceRatio (float value) |
| Sets torqueForceRatio. More...
|
|
float | getSpeedFalloffRatio () const |
| Returns speedFalloffRatio. More...
|
|
void | setSpeedFalloffRatio (float value) |
| Sets speedFalloffRatio. More...
|
|
Q_INVOKABLE QPointF | getGroundNormal () const |
| Returns the current "up" direction used to orient movement. More...
|
|
virtual void | update () override |
| Computes and applys torque and linear forces on this actor's Body. More...
|
|
| Logic (QObject *parent=nullptr) |
| Constructs a Logic. More...
|
|
Actor * | getActor () const |
| Returns actor. More...
|
|
bool | isActive () const |
| Returns active. More...
|
|
void | setActive (bool value) |
| Sets active. More...
|
|
virtual void | init () |
| Performs initialization of this Logic. More...
|
|
| QObject (QObject *parent) |
|
virtual bool | event (QEvent *e) |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
virtual const QMetaObject * | metaObject () const |
|
QString | objectName () const |
|
void | setObjectName (const QString &name) |
|
bool | isWidgetType () const |
|
bool | isWindowType () const |
|
bool | signalsBlocked () const |
|
bool | blockSignals (bool block) |
|
QThread * | thread () const |
|
void | moveToThread (QThread *targetThread) |
|
int | startTimer (int interval, Qt::TimerType timerType) |
|
void | killTimer (int id) |
|
T | findChild (const QString &name, QFlags< Qt::FindChildOption > options) const |
|
QList< T > | findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const |
|
QList< T > | findChildren (const QRegExp ®Exp, QFlags< Qt::FindChildOption > options) const |
|
QList< T > | findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const |
|
const QObjectList & | children () const |
|
void | setParent (QObject *parent) |
|
void | installEventFilter (QObject *filterObj) |
|
void | removeEventFilter (QObject *obj) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
|
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
|
bool | disconnect (const QObject *receiver, const char *method) const |
|
void | dumpObjectTree () |
|
void | dumpObjectInfo () |
|
bool | setProperty (const char *name, const QVariant &value) |
|
QVariant | property (const char *name) const |
|
QList< QByteArray > | dynamicPropertyNames () const |
|
void | destroyed (QObject *obj) |
|
void | objectNameChanged (const QString &objectName) |
|
QObject * | parent () const |
|
bool | inherits (const char *className) const |
|
void | deleteLater () |
|
|
QString | tr (const char *sourceText, const char *disambiguation, int n) |
|
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
|
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
|
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
|
bool | disconnect (const QMetaObject::Connection &connection) |
|
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
|
QObject * | sender () const |
|
int | senderSignalIndex () const |
|
int | receivers (const char *signal) const |
|
bool | isSignalConnected (const QMetaMethod &signal) const |
|
virtual void | timerEvent (QTimerEvent *event) |
|
virtual void | childEvent (QChildEvent *event) |
|
virtual void | customEvent (QEvent *event) |
|
virtual void | connectNotify (const QMetaMethod &signal) |
|
virtual void | disconnectNotify (const QMetaMethod &signal) |
|
Logic which exerts force in a specified direction, causing the actor to roll in that direction.
The movement direction is specified using the direction property. X represents forwards and backwards movement, while Y represents upwards and downwards movement. This "direction" is not always aligned to world space, or even gravity. When the actor is considered "in the air", the reference direction for "up" is gravity. When the actor is close to a surface (i.e. the ground), that surface's normal will be used as "up". Forward and backwards movement will be oriented to this direction.
The closest surface is found approximately by casting several rays. If no surface is found, the actor is considered "in the air" (and orients to gravity). The distance that rays will be cast is controlled by the proximityRadius property. Alternatively, when magnetism is in effect and the actor is near a magnetic object, the direction to that object's center will be used as "up".
The force that is exerted is a combination of torque (angular acceleration) and linear acceleration (i.e. jetpack-like). Because the actor can exert a jetpack-like force, to prevent the actor from "climbing" unnaturally against gravity, damping is applied in the direction of gravity. For example, if the actor's current reference surface is a vertical wall, when the actor moves forwards, it will attempt to climb up (or down) the wall. Since this is against gravity, the amount of force that is effectively exerted is reduced (compared to the force that is exerted when on the ground). The amount of reduction is controlled through the antiGravityAmount property.