Search the Community
Showing results for tags 'Vector3'.
-
Colshape.position return undefined. Is there any ways to get position of colshape clientside. Colshape.getCoords(true/false) also return undefined
-
I mapped objects in CodeWalker and decided to implement server side loading RAGE.MP. But there is a problem that when creating an object via mp.objects.new (), for some reason, rotation does not work .. In XML, rotation consists of 4 values (Quaternion), but RAGE.MP accepts Vector3 Tell me how you can convert values? Found in npm packages three.js library But when I convert from quaternion, the object in the game does not rotate like in CodeWalker .. Gentlemen, developers, tell me how you can rotate the object correctly. Here's a sample code how I convert: var three = require("three"); var object = { "model":"Prop_Container_01d", "position": ["2382.63900000","-2260.29900000","134.54850000"], "rotation": ["0.00000000","0.00000000","0.00000000","1.00000000"], "dimension": 0 }; var quaternion = new three.Quaternion(parseFloat(object.rotation[0]), parseFloat(object.rotation[1]), parseFloat(object.rotation[2]), parseFloat(object.rotation[3])); var convertedRotation = new three.Euler().setFromQuaternion( quaternion ); mp.objects.new(mp.joaat(object.model), new mp.Vector3(parseFloat(object.position[0]), parseFloat(object.position[1]), parseFloat(object.position[2])), { rotation: new mp.Vector3(parseFloat(convertedRotation.x), parseFloat(convertedRotation.y), parseFloat(convertedRotation.z)), dimension: object.dimension });
-
- quaternion
- vector3
-
(and 3 more)
Tagged with: