Example #1
0
    public virtual void Setup()
    {
        physXPosition.FromVector(transform.position);
        physXRotation.FromQuaternion(transform.rotation);
        IntPtr physXTransform = PhysXLib.CreateTransform(physXPosition, physXRotation);

        _position = transform.position;
        _rotation = transform.rotation;
        physXBody = PhysXLib.CreateStaticRigidBody(physXTransform);

        PhysXCollider[] colliders = GetComponentsInChildren <PhysXCollider>(true);

        foreach (PhysXCollider collider in colliders)
        {
            collider.Setup(this, 0);
        }
    }