Jump to content

Is it possible someway...?


Recommended Posts

In theory it is possible using the current MTA functions, lua and maths.

We have the element matrix (3D coordinates and 3 rotation vectors)

We have the element bounding box – more or less the shape of the element and with is surface and volume

we have the moveObject function, that allows us to change the element matrix in any way within given time interval (minimum 50ms) so we can make relatively smooth acceleration simulation

we also can assign any abstraction data (such as mas) to the element using setElementData

and of course using the above data we can calculate collisions between the elements and active forces

unfortunately there would be lag with large number of the elements and maybe some sync problems...

Link to comment

we have the moveObject function, that allows us to change the element matrix in any way within given time interval (minimum 50ms) so we can make relatively smooth acceleration simulation

moveobj is not the way, i have made it as smooth while keeping the flexebility to change the velocity and etc each frame

way i made some throwing stuff(its secret atm)

just store velocity and grav velocity, and onclientrender get time elapsed since last frame, add gravity velocity, multiply it with time, add up current pos with velocity, check line of sight, and if its clear set new pos, if its not, use the hit pos and normal do collide, etc. you can change rotation similarly as well. all you need is mayor physics formula knowledge.

this works well and synced, but there is very slight desync possibility if the fps varies much, but tis basically tipical way how it all works in game.

btw we also have getElementColShape(no idea how accurate it is)

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...