Player moves real slow on StaticMesh

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Dart
Posts: 5
Joined: Sun Apr 24, 2011 5:40 pm

Player moves real slow on StaticMesh

Post by Dart »

I created a static mesh:

Code: Select all

Vector3[] staticTriangleVertices;
int[] staticTriangleIndices;

TriangleMesh.GetVerticesAndIndicesFromModel(Models.LEVEL01, out staticTriangleVertices, out staticTriangleIndices);
            
StaticMesh staticMesh = new StaticMesh(
    staticTriangleVertices,
    staticTriangleIndices,
    new AffineTransform(
        Matrix3X3.Identity,
        Vector3.Zero));

staticMesh.Sidedness = TriangleSidedness.Counterclockwise;

space.Add(staticMesh);
BepuDebug.Add(staticMesh);
The player moves along it and collides at all the right walls. But he moves very slowly and can't jump. If I make the character spawn on a Box entity, he moves at normal speed and can jump, but if I jump off the box down to the StaticMesh I'm back to moving slowly.

Changing the acceleration has no effect on movement. (Unless I'm standing on a Box entity.)

Any ideas? (I'm using the CharacterController for my player.)

Edit: I just tested out the StaticMeshDemo and it's exactly the same. Can't jump on terrain, but you can jump on boxes. I guess I have to look at how IsSupported is calculated.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Player moves real slow on StaticMesh

Post by Norbo »

The CharacterController isn't supposed to be the default character controller choice at the moment (it was included by accident after I was doing some research for the new version). The preferred option is the SimpleCharacterController.

CharacterController does not currently use non-entities as supports, so you can only move using 'air control' and you can't jump when standing on a mesh. SimpleCharacterController is able to use non-entities as supports.

v0.16.0 is slated to include a new character controller which should be significantly more robust than either current option.
Dart
Posts: 5
Joined: Sun Apr 24, 2011 5:40 pm

Re: Player moves real slow on StaticMesh

Post by Dart »

Oh awesome. Thank you!
Post Reply