Пример #1
0
        public override HitResult CheckHit(Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View)
        {
            if (Scale.X == 0 || Scale.Y == 0 || Scale.Z == 0)
            {
                return(HitResult.NoHit);
            }

            MatrixStack transform = new MatrixStack();

            transform.Push();
            transform.NJTranslate(Position);
            transform.NJRotateY(Rotation.Y);
            transform.NJScale((Scale.X), (Scale.Y), (Scale.Z));

            HitResult result = VolumeMesh.CheckHit(Near, Far, Viewport, Projection, View, transform);

            transform.Pop();
            return(result);
        }
Пример #2
0
        public override HitResult CheckHit(Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View)
        {
            if (Scale.X == 0 || Scale.Y == 0 || Scale.Z == 0)
            {
                return(HitResult.NoHit);
            }

            MatrixStack transform = new MatrixStack();

            transform.Push();
            transform.NJTranslate(Position);
            transform.NJRotateY(Rotation.Y);

            switch (CollisionType)
            {
            case (SADXCamColType.CamCol_Sphere):
                transform.NJScale((Scale.X), (Scale.X), (Scale.X));
                break;

            case (SADXCamColType.CamCol_Plane):
                transform.NJScale((Scale.X), (Scale.Y), (1f));
                break;

            case (SADXCamColType.CamCol_Block):
                transform.NJScale((Scale.X), (Scale.Y), (Scale.Z));
                break;

            default:
                transform.NJScale((Scale.X), (Scale.X), (Scale.X));
                break;
            }

            HitResult result = VolumeMesh.CheckHit(Near, Far, Viewport, Projection, View, transform);

            transform.Pop();
            return(result);
        }