Commit b6fd7bc9 authored by James Fulop's avatar James Fulop
Browse files

upgrade collision step transform use correctly

parent 79fbbbad
......@@ -1222,7 +1222,7 @@ void CheckForTeleportation(entity* Entity, uint32 ConfigIndex)
Assert(MoveDelta <= MaxMoveDelta + 1);
}
#define RESTING_VELOCITY 0.1f
void Integrate(entity* Entity, uint32 ConfigSource, uint32 ConfigTarget, real32 DeltaTime)
{
rb_config* Source = &Entity->Configs[ConfigSource];
......@@ -1238,7 +1238,7 @@ void Integrate(entity* Entity, uint32 ConfigSource, uint32 ConfigTarget, real32
if (!Source->IsResting)
{
CheckForTeleportation(Entity, Entity->SourceConfig);
MoveLocal(Target, DeltaTime * (Source->LinearVelocity), false);
SetLocalPosition(Target, Source->LocalPosition + (DeltaTime * (Source->LinearVelocity)), false);
CheckForTeleportation(Entity, Entity->TargetConfig);
}
else
......@@ -1329,8 +1329,7 @@ CollisionStep(render_list* RenderList, collision_group* Group,
real64 CurrentTime = 0;
real64 TargetTime = FIXED_TIME_STEP_DELTA;
#define OUTER_DEPTH_EPSILON 0.005f
#define INNER_DEPTH_EPSILON 0
uint32 Iterations = 0;
while (CurrentTime < FIXED_TIME_STEP_DELTA)
......
......@@ -5,6 +5,11 @@
#define FIXED_TIME_STEP_DELTA 0.011111111111111111111111111
#define RESTING_VELOCITY 0.1f
#define OUTER_DEPTH_EPSILON 0.005f
#define INNER_DEPTH_EPSILON 0
//TODO(james): macro or meta-programming solution for enum-to-string?
enum collision_layer
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment