NegateVector() broken?
I need to reverse a vector.
So i tought using stock NegateVector(Float:vec[3]) but it doesnt change the value at all! i even tryed doing it manually. camAngle2[0] = -clientCamAngle[0]; camAngle2[1] = -clientCamAngle[1]; camAngle2[2] = -clientCamAngle[2]; and i got the same result. Help please? |
Re: NegateVector() broken?
negativing a vector means reverse vector`s "direction".
so vector`s "length" will not be changed. only direction will be changed. |
Re: NegateVector() broken?
if u are really want to see change, just convert that reversed and original vectors to angle and print it. than u will able to see vectors in angle is different
|
Re: NegateVector() broken?
ok. but thats already an angle vector from
MakeVectorFromPoints(point1, point2, vecResult); GetVectorAngles(vecResult, clientCamAngle); and that makes the player look in the exact opposite direction. I dont see the point into converting an angle vec to another angle vector.. but ill try anyway. EDIT Heres the result point1 : 5553.742187 5676.272460 -799.968750 point2 : 5339.999511 6338.448730 -807.968750 vecResult: -213.742675 662.176269 -8.000000 clientCamAngle : 0.658714 107.889465 0.000000 negate() clientCamAngle : 0.658714 107.889465 0.000000 angles() clientCamAngle : 0.000000 89.918075 0.000000 last line is always the same or sometime changes to : 0.000000 90.0000000.000000 no matter what direction im aiming |
Re: NegateVector() broken?
MakeVectorFromPoints(point1, point2, vecResult);
GetVectorAngles(vecResult, clientCamAngle); vecresult is direction vector. yes, it is vector. but, clientcamangle is not vector. it is angle value. like 0˚ ~ 360˚ from it is not vector, u will get incorrect result from reversing that vector. and if u want to get reversed direction of client view angle, just get client eye angle and change it onto vector(u must use vector from first vector buffer of that fucntion) and negate that vector and transfrom it to angle. |
Re: NegateVector() broken?
im confused <_>
I tryed to do that based on your explanation PHP Code:
|
Re: NegateVector() broken?
no not that.
if u want to just get reversed vector of client eye view, - pseudocode decl clienteyeangle getclienteyeangle(client, clienteyeangle) decl vector1 getvectorfromangle(clienteyeangle, vector1, null, null) negatevector(vector1) teleportclient(vector1) |
Re: NegateVector() broken?
more edit : u are want to change angle of client, if so just do this
- pseudocode negatevector(vector1) teleportclient(null, vectortoangle(vector1) null) |
Re: NegateVector() broken?
hm...my pseudo code is suck. i should not use it more lol
|
Re: NegateVector() broken?
Your issue is that the - unary operator doesn't work with floats, I came across that issue recently, so your code would need to be:
PHP Code:
|
All times are GMT -4. The time now is 05:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.