Post: Length Function ported to sprx
01-27-2017, 07:45 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hello NGU,

i recently tried to remake a gsc function called Length.
For those how dont know what this function does it returns the length of the given vector and can be used like this:

    Length( models[j].origin - center );


I have to admit that im not the best in writing functions like that.
I came across a Counter strike source and tried to port it to ps3

    float length(float* value)
{
float X = value[0] * value[0];
float Y = value[1] * value[1];
float Z = value[2] * value[2];
float dis = (float)sqrt(X + Y + Z);
return dis;
}


But it doesnt seem to work correctly, and i dont know if it even is the correct function.
Maybe some of you already made one or can help me out Smile
Thanks for your time
09-11-2017, 03:24 PM #2
S63
Space Ninja
Originally posted by OhBOOY View Post
Hello NGU,

i recently tried to remake a gsc function called Length.
For those how dont know what this function does it returns the length of the given vector and can be used like this:

    Length( models[j].origin - center );


I have to admit that im not the best in writing functions like that.
I came across a Counter strike source and tried to port it to ps3

    float length(float* value)
{
float X = value[0] * value[0];
float Y = value[1] * value[1];
float Z = value[2] * value[2];
float dis = (float)sqrt(X + Y + Z);
return dis;
}


But it doesnt seem to work correctly, and i dont know if it even is the correct function.
Maybe some of you already made one or can help me out Smile
Thanks for your time


yo whats your skype again bro i lost it?
09-11-2017, 03:25 PM #3
S63
Space Ninja
Originally posted by OhBOOY View Post
Hello NGU,

i recently tried to remake a gsc function called Length.
For those how dont know what this function does it returns the length of the given vector and can be used like this:

    Length( models[j].origin - center );


I have to admit that im not the best in writing functions like that.
I came across a Counter strike source and tried to port it to ps3

    float length(float* value)
{
float X = value[0] * value[0];
float Y = value[1] * value[1];
float Z = value[2] * value[2];
float dis = (float)sqrt(X + Y + Z);
return dis;
}


But it doesnt seem to work correctly, and i dont know if it even is the correct function.
Maybe some of you already made one or can help me out Smile
Thanks for your time


remove this, it copied my comment above
Last edited by S63 ; 09-13-2017 at 07:14 PM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo