Skip to content
Permalink
Browse files

[Bullet] Rely on our bullet for math conversions

  • Loading branch information
Eideren committed Apr 18, 2019
1 parent 392c86d commit 635d83914320dc3208a966545c3b5a6fcad769fd
Git LFS file not shown
@@ -28,8 +28,8 @@ public void Jump(Vector3 jumpDirection)
{
throw new InvalidOperationException("Attempted to call a Physics function that is avaliable only when the Entity has been already added to the Scene.");
}

KinematicCharacter.Jump(jumpDirection);
BulletSharp.Math.Vector3 bV3 = jumpDirection;
KinematicCharacter.Jump(ref bV3);
}

/// <summary>
@@ -78,8 +78,11 @@ public float FallSpeed
set
{
fallSpeed = value;

KinematicCharacter?.SetFallSpeed(value);

if (KinematicCharacter != null)
{
KinematicCharacter.FallSpeed = fallSpeed;
}
}
}

@@ -135,7 +138,10 @@ public float JumpSpeed
{
jumpSpeed = value;

KinematicCharacter?.SetJumpSpeed(value);
if (KinematicCharacter != null)
{
KinematicCharacter.JumpSpeed = jumpSpeed;
}
}
}

@@ -255,7 +261,8 @@ protected override void OnAttach()

NativeCollisionObject.ContactProcessingThreshold = !Simulation.CanCcd ? 1e18f : 1e30f;

KinematicCharacter = new BulletSharp.KinematicCharacterController((BulletSharp.PairCachingGhostObject)NativeCollisionObject, (BulletSharp.ConvexShape)ColliderShape.InternalShape, StepHeight, Vector3.UnitY);
BulletSharp.Math.Vector3 unitY = new BulletSharp.Math.Vector3(0f, 1f, 0f);
KinematicCharacter = new BulletSharp.KinematicCharacterController((BulletSharp.PairCachingGhostObject)NativeCollisionObject, (BulletSharp.ConvexShape)ColliderShape.InternalShape, StepHeight, ref unitY);

base.OnAttach();

@@ -617,7 +617,7 @@ public XenkoAllHitsConvexResultCallback(IList<HitResult> results)
resultsList = results;
}

public override float AddSingleResult(BulletSharp.LocalConvexResult convexResult, bool normalInWorldSpace)
public override float AddSingleResult(ref BulletSharp.LocalConvexResult convexResult, bool normalInWorldSpace)
{
Vector3 normal;
if (normalInWorldSpace)
@@ -646,7 +646,7 @@ public XenkoAllHitsRayResultCallback(ref Vector3 from, ref Vector3 to, IList<Hit
resultsList = results;
}

public override float AddSingleResult(BulletSharp.LocalRayResult rayResult, bool normalInWorldSpace)
public override float AddSingleResult(ref BulletSharp.LocalRayResult rayResult, bool normalInWorldSpace)
{
Vector3 normal;
if (normalInWorldSpace)

This file was deleted.

0 comments on commit 635d839

Please sign in to comment.
You can’t perform that action at this time.