Fix bobbing camera
This commit is contained in:
parent
0ed4fa8244
commit
17b6d10324
|
@ -107,10 +107,12 @@ void pointConstraintInit(struct PointConstraint* constraint, struct CollisionObj
|
|||
constraint->teleportOnBreak = teleportOnBreak;
|
||||
constraint->movementScaleFactor = movementScaleFactor;
|
||||
constraint->object->body->flags &= ~RigidBodyIsSleeping;
|
||||
constraint->object->body->sleepFrames = IDLE_SLEEP_FRAMES;
|
||||
}
|
||||
|
||||
void pointConstraintUpdateTarget(struct PointConstraint* constraint, struct Vector3* worldPoint, struct Quaternion* worldRotation) {
|
||||
constraint->targetPos = *worldPoint;
|
||||
constraint->targetRot = *worldRotation;
|
||||
constraint->object->body->flags &= ~RigidBodyIsSleeping;
|
||||
constraint->object->body->sleepFrames = IDLE_SLEEP_FRAMES;
|
||||
}
|
|
@ -6,12 +6,9 @@
|
|||
#include "defs.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#define VELOCITY_SLEEP_THRESHOLD 0.001f
|
||||
#define ANGULAR_VELOCITY_SLEEP_THRESHOLD 0.001f
|
||||
|
||||
#define IDLE_SLEEP_FRAMES ((int)(0.5f / FIXED_DELTA_TIME))
|
||||
|
||||
void rigidBodyInit(struct RigidBody* rigidBody, float mass, float momentOfIniteria) {
|
||||
transformInitIdentity(&rigidBody->transform);
|
||||
rigidBody->velocity = gZeroVec;
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
#include "../math/mathf.h"
|
||||
#include "./collision.h"
|
||||
|
||||
|
||||
#define IDLE_SLEEP_FRAMES ((int)(0.5f / FIXED_DELTA_TIME))
|
||||
|
||||
#define KILL_PLANE_Y -10.0f
|
||||
|
||||
#define RIGID_BODY_NO_ROOM 0xFFFF
|
||||
|
|
Loading…
Reference in a new issue