Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/11/19 in all areas

  1. For long time i considered to do something with physics in mta. For now doing even simplest things such falling box, tree on flat area looks cartoonish. In my history of i saw few attempts of doing simple physics, mostly it was in closed area without bigger interactions with poor performance due you just can't calculate collision in other way than processLineOfSight, isLineOfSightClear or read directly .col file as Tederis did. I started with something to render things, thats how FBX https://github.com/multitheftauto/mtasa-blue/pull/1093 to bypass default rendering to handle future i'll introduce in future. That's how bullet physics project born, first idea how to use react physics, works simillar but is lighter and general smaller project but 0x416c69 suggested to use bullet. I'll use this topic also to prepare long list of features it contains for future copy paste to PR and wiki page The main assumption is to allow for create multiple world with completly independed simulations, get and set detailed information about current step of simulation, fully control how everything is simulated, quality of collision tests, speed and a lot more. i'm trying keep amount of functions low, because if that most stuff is packed into one function. Syntax and name of some function might change in future or along suggestions. Not all properties supports every physics element, some are only get, other set only, however most of them are set/get Current stage: I already implemented function such a: physics physicsCreateWorld() - responsible for creating new world for simulations, return element which will use later. physics-rigidbody physicsCreateRigidBody( shape-type, mixed arguments ) - creates rigid body which is use to simulation bahaviour of non-static shapes, collisions ( currently only few models in mta can do this in simple way ). physics-rigidbody physicsCreateRigidBodyFromModel( model ) - used to create rigid body directly from collision data taken from gta model. physics-static-collision physicsCreateStaticCollision( shape-type, mixed arguments ) - creates static collision which will not move at all ( it is still possible to move it by Lua script ) physics-shape physicsAddShape( shape-type, mixed arguments ) - if you create compound shape, this function let you add more shapes into static collision or rigid body bool physicsSetProperties( any physics element, physics-property, mixed arguments ) - main function to control physics, rigid bodies, static collisions, shapes. Works in simillar way as handling functions. mixed physicsGetProperties( any physics element, physics-property ) - same as above, but getting properties bool physicsDrawDebug( physics ) - use to visualization of world, must be used in render function bool physicsSetDebugMode( physics-debug-mode, enabled ) - use to turn off/on debugging features bool physicsBuildCollisionFromGTA( physics ) - used to create static collisions in specified world from original collisions, doesn't create whole world instantly, require to move player around world to load collision data. physics-constraint physicsCreateConstraint( physics, physics-rigid-body, physics-rigid-body, constraint-type, mixed arguments ) - use to connecting two or more rigid bodies into one entity bool physicsApplyForce( physics-rigid-body, vector from, vector to ) - pushing rigid body in particular point you choosed. bool physicsApplyCentralForce( physics-rigid-body, vector direction ) - apply force from central position of rigid, it's more like "accelereate", should be used more than once at the some period of time bool physicsApplyCentralImpulse( physics-rigid-body, vector direction ) - setting position from center of rigid bool physicsApplyDamping( physics-rigid-body, float force ) - i'm not sure, but it should slow down velocity and rotation of model by specified amount of units physicsApplyImpulse( physics-rigid-body, vector direction ) - i'm not sure how it works physicsApplyTorque( physics-rigid-body, vector rotation ) - same as physicsApplyCentralForce but for rotation physicsApplyTorqueImpulse( physics-rigid-body, vector rotation ) - setting rotation speed physics-properties: "mass", "position" ,"rotation", "sleepingthresholds", "restitution", "scale" "debugcolor", "filtermask", "filtergroup", "stiffness" `sleepingthresholds` means how slow rigid must move/rotate to sleep, it makes stops moving at all but still can be pushed by other rigids `restitution` bounciness, between 0-1 but accept any value above `stiffness` - for fixed constraint `filtermask` i still figuring out how it work, but should let you use 32 bit mask to set which rigid with which should collide Bullet documentation: https://github.com/bulletphysics/bullet3/blob/master/docs/Bullet_User_Manual.pdf page 13 contains useful information when which shape should be used physics-constraints: "pointtopoint", "hidge", "fixed", "slider" Physics-shapes: "box", "sphere", "capsule", "cone", "cylinder", "heightfieldterrain", "compound", "trianglemesh", "convexhull" `compound` is used for constructing rigid made of various shapes Plans for future: "heightfieldterrain" shape type accept black-white texture for faster creation Support for cloths, soft bodies Media: Videos are availiable at my youtube channel https://www.youtube.com/channel/UC95MpsQ1JppDNpMvl_7c1rg screenshots and gifs of current progress: Documentation i use: https://pybullet.org/Bullet/BulletFull I'm waiting for your suggestions Topic not finishedd
    1 point
  2. function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true)
    1 point
  3. I think the problem is that the font size used by the actual input boxes (that you have hidden) is smaller than that of the labels used to show the input. So the text width doesn't match.
    1 point
  4. ماتوقف عند 1 يعني ترجع من جديد CosineCurve & CosineCurve هي نفسها تقريباً لأن getTickCount عموماً, إذا تبغى نفس طريقتك استخدم متغير بدون local tick = 0 addEventHandler("onClientRender", root, function() tick = tick + 0.01 local T = math.min( tick, 1 ); if T == 1 then tick = 0 end test.moveX = interpolateBetween(test.moveX, test.moveY, 0, 1, 0, 0, T, "Linear") dxDrawText("FOR TESTING A SOMETHING ALPHA 1.0",sX*0.35-test.moveX,sY*0.15,250,250,tocolor(255,255,255,255), 2.00, "default-build", "left", "center", false) end )
    1 point
  5. Here you have an example. Just try it.
    1 point
  6. Tested this out this morning. I'm hooked! BUT!! This server needs more exposure. Is MTA SA well known in steam forum or something like that? Maybe you can try to announce it there or something... Maybe persuade some known youtube gamers to go maybe revisit this classic game, and try this server and MTA SA in general? Okay let me express something: MAN!! I've been missing a lot this whole time. Wasn't that familiar with MTA SA in the first place, though back in the day, I played SAMP, A LOT. To see a game as old as 12 years with no multiplayer support, originally..still kicks butt with the fans creating these kinds of thing, is just...mind boggling. Okay, Battlefield 2 still has Project Reality with it's dedicated players to this day, but with a game like GTA SA...the possibilities are massive. And for this server in particular.... I mean for example... I've been dreaming about cannon projectiles trajectory and front/rear armor mechanic for a long time, then all of the sudden... ...you and your team made it happen. Not only that, but you guys went ALL. OUT. No half-assed effort, no lollygagging. But BAM!! You put your very bests into this. That said, of course I expect something more in the future. Maybe more content, maybe some fixes and adjustment, whatever... But of course, with community supports and feedback. Thus, I'm hoping for more participants to enjoy this marvelous work. Perhaps..actually, no. I'M SURE, that way, there'll be more crazy ideas, feedbacks, and suggestions to be brought forth and/or implemented in this. Best wishes to everyone involved in this, MTA team, and last but not least, the players and the community.
    1 point
  7. My god... This is magnificent!! I don't even play MTA SA, yet I'm attracted to this. I'm considering getting a PC of some sort, and I'm just coming by to say that you (creator/s) had done an amazing job! Other than that, I come to ask you to confirm my insecure question; This server will run for a long time, yes? Because that'll be how long it takes for me to join. And somehow... I always got this nagging feeling about anything exciting usually goes vanish before I can even get a taste. Heh. No, I'm not trying to jinx.
    1 point
×
×
  • Create New...