notgiven688 / jitterphysics

A cross-platform, realtime physics engine for all .NET apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raycast not going further then half a meter.

Kas-2 opened this issue · comments

commented

Just what it says,

My code for ray detection is:

` public DetectTest(Character info, Vector3 forward)
{
JVector hitNormal;
float fraction;
bool result;

        JQuaternion rot = JQuaternion.CreateFromMatrix(info.bodyJitter.Orientation);
        JVector rotVector = new JVector(rot.X, rot.Y, rot.Z);
        JVector basePos = info.bodyJitter.Position;
        result = Program.jitterPhysics.world.CollisionSystem.Raycast(basePos + new JVector(forward.x / .5f,
            forward.y / .5f, forward.z / .5f),
            new JVector(rot.X, rot.Y, rot.Z),
            RaycastCallback,
            out resBody,
            out hitNormal,
            out fraction);
        this.result = result;

        if (resBody != null)
        {
            Console.WriteLine(resBody.Position);
        }
        //Console.WriteLine(result ? "Hitted something!" : "No hit detected!");
    }`
commented

Well, the issue is not resolved. I've moved on to Unity physics. But it's sad that you don't respond, was quite a nice engine.