Closed GoogleCodeExporter closed 9 years ago
Box fire towards the edge of the screen doesn't fire straight, fires at a weird
angle
Mouse picking either doesn't work at all or just paints the point2point
constraint transform onto the object
Original comment by patricks...@gmail.com
on 8 May 2011 at 10:07
I can confirm both of those.
Original comment by andres.traks
on 9 May 2011 at 9:30
I'll double check the box firing as that was definitely working, though the
aiming of the boxes was a bit rubbish. picking definitely missing though.
Original comment by xexu...@gmail.com
on 9 May 2011 at 9:33
The field of view in GetRayTo is wrong. FOV is defined as 40 degrees in the
projection matrix, so instead of:
public Vector3 GetRayTo(int x, int y)
{
float top = 1f;
float bottom = -1f;
float nearPlane = 1f;
float tanFov = (top - bottom) * 0.5f / nearPlane;
float fov = 2.0f * (float)Math.Atan(tanFov);
...
you just need:
public Vector3 GetRayTo(int x, int y)
{
float fov = MathHelper.ToRadians(40.0f);
...
Original comment by andres.traks
on 9 May 2011 at 10:02
I applied that patch.
Original comment by andres.traks
on 9 May 2011 at 10:11
Picking Constraint has been fixed in demo.
Original comment by xexu...@gmail.com
on 20 Jun 2012 at 9:15
Original issue reported on code.google.com by
patricks...@gmail.com
on 8 May 2011 at 10:04