![]() Didn't event thought about element matrix method, I will use it. ![]() In the mean time, you could get the rotation from the object from its Matrix, which is not the best of solutions, but should be very straight forward. Lets try to add dynamically property of an object and the property must be function and variable in javascript. (first row of numbers X,Y,Z position, second row of numbers RX,RY,RZ) Engineering Computer Science Q&A Library Lets try to add dynamically property of an object and the property must be function and variable in javascript. Return x, y, z - Return the transformed point end With Lightwave 3D I created a Dynamic Object Gravity Effectorthen I created an orbital mesh and give it some cloth properties after a few days of tweaking an. Local z = offX * m + offY * m + offZ * m + m Local zx, zy, zz = getPositionFromElementMatrixOffset(mat, 0, 0, 1)ĭxDrawLine3D(x, y, z, xx, xy, xz, tocolor( 200, 0, 0, 200), 5.0)ĭxDrawLine3D(x, y, z, yx, yy, yz, tocolor( 0, 200, 0, 200), 5.0)ĭxDrawLine3D(x, y, z, zx, zy, zz, tocolor( 0, 0, 200, 200), 5.0)Įnd addEventHandler( "onClientRender ", root, onRender)įunction getPositionFromElementMatrixOffset( m, offX, offY, offZ) - local x = offX * m + offY * m + offZ * m + m - Apply transform local y = offX * m + offY * m + offZ * m + m Local yx, yy, yz = getPositionFromElementMatrixOffset(mat, 0, 1, 0) convertFFS is arguably the best object and vehicle converter out there for the GTA: San Andreas modifications SA-MP and MTA. Local xx, xy, xz = getPositionFromElementMatrixOffset(mat, 1, 0, 0) Local rx, ry, rz = getElementRotation(pizza)ĭxDrawText(x. Local x, y, z = getElementPosition(pizza) Local pizza = createObject( 1582, 0, 0, 5) ![]() While in vehicle, move close to the placed object, rotate camera in the direction of placed. Get into any vehicle that can accelerate and move beyond 40km/h. Create any building/road or any other, preferably big, object on map in clear space. It always returns (0, 0, 0) unless rotation is set manually.Ībout ur solution for sync: I've already done it, but faced this problem with getting rotation it seems there is no way to get real rotation of 'object with physics' after player/other element touches it, it still return last manually set rotation (including creation rotation of course). Camera ignores any placed object collisions when player in vehicle reaches certain speed. Unable to get real rotation of dynamic object on clientside too. I made a basketball minigame a while ago and I used a dynamic object, but this object was synced by the one that had thrown the ball (or had it in its hands atm) so even if there was a lot of desync (which there was) it would come back to sync after certain criteria for syncing was complete (someone scored, the ball was dropped or stop moving, etc.) What you need to do to fix this issue on your own is to make a custom syncer for the thing you are trying to do, if any. You should be able to get the rotation of the object clientside, but you would soon notice that the objects movements are pretty wacky and erratic, they tend to get out of sync almost instantly after touching them. I dont know how worth it it really is tho. However, sometimes we have fixed and dynamic properties mixed in a single JSON object.With dynamic objects you are talking about the ones with physics right?Īfaik those arent synced with the server, because the server doesnt understand RenderWave or the gtasa engine on a real level, unlike goldsource or source for example.īecause of that, the only way to get the real rotation of a dynamic object serverside would be to have a syncer that reports the rotation every few ticks or when the function is executed. The previous solutions are good when an object contains only dynamic properties.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |