38 return movement * (1f / divisor);
57 this.angularVelocity = Vector3.zero;
75 Quaternion deltaRotation = Quaternion.Inverse(fromPose.
rotation) * toPose.
rotation;
77 this.velocity = deltaPosition / dt;
78 this.angularVelocity = deltaRotation.ToAngleAxisVector() / dt;
89 velocity += linearAcceleration * deltaTime;
97 Vector3 angularAcceleration,
99 velocity += linearAcceleration * deltaTime;
128 Vector3 angularAcceleration,
136 public static class MovementExtensions {
138 public static Pose Integrated(
this Pose thisPose,
Movement movement,
float deltaTime) {
143 thisPose.
rotation = Quaternion.AngleAxis(angVelMag * deltaTime,
void Integrate(float deltaTime)
KinematicState(Pose pose, Movement movement)
void Integrate(Vector3 linearAcceleration, float deltaTime)
void Integrate(Vector3 linearAcceleration, Vector3 angularAcceleration, float deltaTime)
Movement(Pose fromPose, Pose toPose, float dt=1f)
Returns the Movement necessary to go from Pose p0 to Pose p1 in dt seconds. You can ignore the time p...
static Movement operator/(Movement movement, float divisor)
static Movement operator*(Movement movement, float multiplier)
static Movement operator+(Movement movement0, Movement movement1)
Movement(Vector3 velocity)
Constructs a linear Movement involving no rotation.
Vector3 angularVelocity
Angular velocity expressed as an angle-axis vector with angle equal to the length of the vector in de...
void Integrate(Vector3 linearAcceleration, float deltaTime)
Discretely integrates this Movement's velocity by a linear acceleration over deltaTime.
void Integrate(Vector3 linearAcceleration, Vector3 angularAcceleration, float deltaTime)
Discretely integrates this Movement's velocity and angular velocity by both a linear acceleration ter...
static readonly Movement identity
Vector3 velocity
The linear velocity of this Movement.
Movement(Vector3 velocity, Vector3 angularVelocity)
Constructs a Movement with a specified linear velocity and an angular velocity.
A position and rotation. You can multiply two poses; this acts like Matrix4x4 multiplication,...