SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 21/02/2013, 04:11 PM   #11
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: All GTA SA Object Array

Quote:
Originally Posted by MP2 View Post
Do ANY of the objects actually USE the rx/ry rotation? NONE of them seem to. I guess you could remove them?

EDIT: Hmm, a few (less than 1 percent) use x and y rotation :/

Perhaps it may be an idea to store them in files? Eh idk.
Unless you don't mind two arrays which would mean more coding when using the array so it's probably best off the way it is.

Vince - That is up to the scripter if they want to do it.
Pottus is offline   Reply With Quote
Old 10/02/2014, 04:50 PM   #12
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 317
Default Re: All GTA SA Object Array

Compiler gets stuck -.-
I never did anything just included it and created a function getobjinfo which prints(the print() thing :P ) the information.
Yashas is offline   Reply With Quote
Old 10/02/2014, 05:04 PM   #13
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: All GTA SA Object Array

It takes a long time to compile but it should finish.
Pottus is offline   Reply With Quote
Old 10/02/2014, 05:47 PM   #14
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 913
Reputation: 635
Default Re: All GTA SA Object Array

Anyway how did you convert the rotation values from quaternion to euler angles?
__________________
I don't play and have ANY interest in SA:MP anymore! Please do not ask for help, because I'm not going to reply.
kurta999 is offline   Reply With Quote
Old 11/02/2014, 12:58 AM   #15
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: All GTA SA Object Array

Quote:
Originally Posted by kurta999 View Post
Anyway how did you convert the rotation values from quaternion to euler angles?
Pretty sure this was it

pawn Code:
QuatToEulerZXY(Float:quat_x, Float:quat_y, Float:quat_z, Float:quat_w, &Float:x, &Float:y, &Float:z)
{
    x = -asin(2 * ((quat_x * quat_z) + (quat_w * quat_y)));
    y = atan2(2 * ((quat_y * quat_z) + (quat_w * quat_x)), (quat_w * quat_w) - (quat_x * quat_x) - (quat_y * quat_y) + (quat_z * quat_z));
    z = -atan2(2 * ((quat_x * quat_y) + (quat_w * quat_z)), (quat_w * quat_w) + (quat_x * quat_x) - (quat_y * quat_y) - (quat_z * quat_z));
    return 1;
}
Pottus is offline   Reply With Quote
Old 11/02/2014, 04:40 AM   #16
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 913
Reputation: 635
Default Re: All GTA SA Object Array

Quote:
Originally Posted by [uL]Pottus View Post
Pretty sure this was it

pawn Code:
QuatToEulerZXY(Float:quat_x, Float:quat_y, Float:quat_z, Float:quat_w, &Float:x, &Float:y, &Float:z)
{
    x = -asin(2 * ((quat_x * quat_z) + (quat_w * quat_y)));
    y = atan2(2 * ((quat_y * quat_z) + (quat_w * quat_x)), (quat_w * quat_w) - (quat_x * quat_x) - (quat_y * quat_y) + (quat_z * quat_z));
    z = -atan2(2 * ((quat_x * quat_y) + (quat_w * quat_z)), (quat_w * quat_w) + (quat_x * quat_x) - (quat_y * quat_y) - (quat_z * quat_z));
    return 1;
}
I have used this and 70-80% of the rotations was incorrect.
__________________
I don't play and have ANY interest in SA:MP anymore! Please do not ask for help, because I'm not going to reply.
kurta999 is offline   Reply With Quote
Old 31/03/2014, 02:09 AM   #17
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: All GTA SA Object Array

Is there a way to get Quaternion to Euler angles more correctly? The function you showed above was only correct on a few, which was mostly the angles less than 180^o...
Crayder is offline   Reply With Quote
Old 02/04/2014, 02:56 AM   #18
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: All GTA SA Object Array

I'd have to ask Stylock for the correct function yes I was mistaken that one is incorrect.
Pottus is offline   Reply With Quote
Old 29/04/2014, 12:57 PM   #19
satafinix
Huge Clucker
 
satafinix's Avatar
 
Join Date: Apr 2013
Location: Marruecos
Posts: 300
Reputation: 15
Default Re: All GTA SA Object Array

Good Work, to userfull
__________________
SA-MP: 5.231.53.212:7777
TS3: TS3.swx-stunting.ga
satafinix is offline   Reply With Quote
Old 05/05/2014, 07:03 PM   #20
BigETI
Banned
 
Join Date: Mar 2010
Location: Germany
Posts: 1,046
Reputation: 359
Default AW: All GTA SA Object Array

You could just pre-compute and store all map objects into a file or a database, so the script can gather object information at runtime, by calculating the position of the data inside the file or send a query to a database engine. If you rather want the information to be accessed faster at runtime, but you don't want to wait minutes to compile your script, you could store the data into dynamicly allocated memory at runtime from a file or database while intializing the script.
BigETI is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EditDynamicObject & Array of object ID [Help] Marricio Scripting Help 1 16/08/2012 09:07 AM
(dFile) error 047: array sizes do not match, or destination array is too small Jack_Leslie Scripting Help 0 06/09/2011 01:20 AM
[SOLVED]error 047: array sizes do not match, or destination array is too small help! Help Archive 7 18/06/2011 08:09 PM
[Sloved]error 047: array sizes do not match, or destination array is too small CoaPsyFactor Help Archive 1 09/06/2011 08:27 PM
<Php> 'Cannot use object of type stdClass as array' DeathOnaStick Help Archive 2 20/09/2010 04:48 PM


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.