• Create Account

Member Since 09 Aug 2002
Offline Last Active Mar 11 2016 03:11 AM

### In Topic: Whats the preferred method of storing a "rotation segment/area/field/rang...

18 July 2015 - 12:08 PM

If the dot product between forward vector and plane normal is negative, then I need to "rotate" the vector to be same "direction" as the plane (not sure on the correct mathematical term). Problem is how do I do this "rotation"?

Reflect it in the plane which is normal to the cone axis first then proceed as before. If you are already on that plane add some scaled amount of the cone direction to it.

### In Topic: Whats the preferred method of storing a "rotation segment/area/field/rang...

18 July 2015 - 04:36 AM

And if you need to clamp it you can just subtract a vector in direction from the end of the the orientation to the end of the cone axis until the cosine is equal, then renormalise, I believe.

### In Topic: Whats the preferred method of storing a "rotation segment/area/field/rang...

18 July 2015 - 02:12 AM

Use an axis and an angle, then check whether the proposed orientation dot axis is within the angle, it's a cone check, if both axes are normalised the dot product will be > cos(angle) if it is within the cone

EDIT: > not <

### In Topic: How many of you write self-documenting code?

09 July 2015 - 09:30 AM

code like "if (n<=0) /* if n is a negative  number*/" is just silly.

And incorrect ;) 0 is not a negative number

### In Topic: c++ friend classes

04 March 2015 - 03:04 AM

You would use porsche.Steer(); in the member function PorscheSteer. But Steer is public anyway, so there's no need for it to be a friend to call that function...

PARTNERS