Esempio n. 1
0
        public CharacterControllerRef(CharacterControllers characters, Vector3 initialPosition, Capsule shape,
                                      float speculativeMargin, float mass, float maximumHorizontalForce, float maximumVerticalGlueForce,
                                      float jumpVelocity, float speed, float airControlForceScale, float airControlSpeedScale, float maximumSlope = MathF.PI * 0.25f)
        {
            this.characters = characters;
            var shapeIndex = characters.Simulation.Shapes.Add(shape);

            bodyHandle = characters.Simulation.Bodies.Add(BodyDescription.CreateDynamic(initialPosition, new BodyInertia {
                InverseMass = 1f / mass
            }, new CollidableDescription(shapeIndex, speculativeMargin), new BodyActivityDescription(shape.Radius * 0.02f)));
            Body = new BodyReference(bodyHandle, characters.Simulation.Bodies);
            ref var character = ref characters.AllocateCharacter(bodyHandle);
 public CharacterNarrowphaseCallbacks(CharacterControllers characters)
 {
     Characters = characters;
 }