[Plugin] cimulator - collision detection and physics simulation
#1

cimulator
collision detection and physics simulation

cimulator is mainly focuses on server side third-party physics simulation. This plugin is purely dependent upon bullet physics library. They key features of this plugin is pretty simple, Simulation can be done with any object of Grand Theft Auto SanAndreas with a proper collision shape. SanAndreas has a world of 44759 map objects and this why the simulation uses more CPU power. Keep a track on latest commits at the github repository of cimulator. The latest version of this plugin supports server-synced simulation to avoid usage of timers, hence reduces the stress on CPU.


Showcasing Simulation

[ame="http://www.youtube.com/watch?v=BYVxElZ-FpA"]cimulator[/ame]

[ame="http://www.youtube.com/watch?v=T0ZoGjewz1w"]Stack Simulation[/ame]


Natives

Код:
native CR_EnableSimulation();
native CR_DisableSimulation();
native CR_Load(Float:worldrest = 0.0);
native CR_RemoveColMap();
native CR_RemoveBuilding(modelid, Float:x, Float:y, Float:z, Float:range);
native CR_SetWorldGravity(Float:x, Float:y, Float:z); 
native CR_GetWorldGravity(&Float:x, &Float:y, &Float:z); 
native CR_RayCastNormal(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x3, &Float:y3, &Float:z3);
native CR_RayCast(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x3, &Float:y3, &Float:z3);
native CR_RayCastEx(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x3, &Float:y3, &Float:z3, &modelid);
native CR_RayCastReflection(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:rx, &Float:ry, &Float:rz, &Float:angle);
native CR_RayCastObjectInfo(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &modelid, &Float:boundingRadius, &isStatic);
native CR_RayCastIntData(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x3, &Float:y3, &Float:z3, &data);
native CR_RayCastFloatData(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x3, &Float:y3, &Float:z3, &Float:data);
native CR_FreeMemory();
native CR_RemoveDynamicCol(index);
native CR_RemoveStaticCol(index);
native CR_CreateDynamicCol(objectid, modelid, Float:mass, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll, inertia = 0, tag = ACTIVE_TAG);
native CR_CreateStaticCol(objectid, modelid, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll);
native CR_GetDynamicColModel(index);
native CR_GetStaticColModel(index);
native CR_SetMass(index, Float:mass);
native Float:CR_GetMass(index);
native CR_SetDynamicColShape(index, modelid);
native CR_SetStaticColShape(index, modelid);
native CR_GetBoundingSphere(modelid, &Float:x, &Float:y, &Float:z, &Float:radius);
native CR_GetAABB(modelid, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll, &Float:minx, &Float:miny, &Float:minz, &Float:maxx, &Float:maxy, &Float:maxz);
native CR_GetTransform(index, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz);
native CR_SetDynamicOrigin(index, Float:x, Float:y, Float:z);
native CR_SetStaticOrigin(index, Float:x, Float:y, Float:z);
native CR_GetDynamicOrigin(index, &Float:x, &Float:y, &Float:z);
native CR_GetStaticOrigin(index, &Float:x, &Float:y, &Float:z);
native CR_SetDynamicRotation(index, Float:yaw, Float:pitch, Float:roll);
native CR_SetStaticRotation(index, Float:yaw, Float:pitch, Float:roll);
native CR_GetDynamicRotation(index, &Float:yaw, &Float:pitch, &Float:roll);
native CR_GetStaticRotation(index, &Float:yaw, &Float:pitch, &Float:roll);
native CR_SetLinearVelocity(index, Float:vx, Float:vy, Float:vz);
native CR_GetLinearVelocity(index, &Float:vx, &Float:vy, &Float:vz);
native CR_SetAngularVelocity(index, Float:vx, Float:vy, Float:vz);
native CR_GetAngularVelocity(index, &Float:vx, &Float:vy, &Float:vz);
native CR_SetTorque(index, Float:tx, Float:ty, Float:tz);
native CR_SetFriction(index, Float:friction);
native Float:CR_GetFriction(index);
native CR_SetRestitution(index, Float:rest);
native Float:CR_GetRestitution(index);
native CR_IsDynamicSlotUsed(index);
native CR_IsStaticSlotUsed(index);
native CR_IsActive(index);
native CR_IsMoving(index);
native CR_Activate(index);
native CR_Simulator(newtime, oldtime);
native CR_GetNumCollisionObject();
native CR_GetNumChildShapes(modelid);
native CR_IsCompound(modelid);
native CR_Wait(ms);
native CR_DynamicContactTest(index);
native CR_ContactTestEx(modelid, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll);
native CR_CharacterContactTest(Float:x, Float:y, Float:z, Float:radius, Float:height);
native Float:CR_GetContactPoints(index, &Float:x1, &Float:y1, &Float:z1, &Float:x2, &Float:y2, &Float:z2);
native CR_GetTimeMilliseconds();
native CR_GetDynamicColObject(index);
native CR_GetStaticColObject(index);
native CR_SetDynamicUserData(index, type, {Float,_}:...);
native CR_SetStaticUserData(index, type, {Float,_}:...);
native CR_GetDynamicInt(index, &data);
native CR_GetDynamicFloat(index, &Float:data);
native CR_GetStaticInt(index, &data);
native CR_GetStaticFloat(index, &Float:data);
native CR_GetStaticPool();
native CR_GetDynamicPool();
native Float:CR_PlacementCorrection(modelid, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll);
native CR_CreateVehicleCol(vehicleid, modelid, Float:x, Float:y, Float:z, Float:qx, Float:qy, Float:qz, Float:qw);
native CR_RemoveVehicleCol(index);
native CR_SetVehicleOrigin(index, Float:x, Float:y, Float:z);
native CR_GetVehicleOrigin(index, &Float:x, &Float:y, &Float:z);
native CR_SetVehicleRotation(index, Float:qx, Float:qy, Float:qz, Float:qw);
native CR_GetVehicleRotation(index, &Float:qx, &Float:qy, &Float:qz, &Float:qw);
native CR_GetVehicleID(index);
native CR_GetVehicleModel(index);
native CR_IsVehicleSlotUsed(index);
native CR_VehicleContactTest(modelid, Float:x, Float:y, Float:z, Float:yaw, Float:pitch, Float:roll);
native CR_GetVehiclePool();
stock CR_SetTransform(index, Float:x, Float:y, Float:z, Float:rotx, Float:roty, Float:rotz)
stock CR_UpdateTransform(index)
stock CR_DestroyAllColVolumes(vehicle = 0)
stock CR_DestroyDynamicCol(index)
stock CR_DestroyStaticCol(index)
stock CR_FlushMemory()
stock CR_ThrowObject(playerid, index, Float:speed)
stock CR_GetForwardObjectInfo(playerid, Float:distance, &modelid, &Float:boundingRadius, &isStatic)
stock CR_PlaceObjectOnGround(objectid, modelid)
stock CR_FindZ_For2D(Float:x, Float:y, &Float:z)
Documentation on all functions are provided at cimulator.inc. I would suggest you to go through cimulator.pdf in the download file for more detailed information including some FAQs.

Download

cimulator-1.09
Reply


Messages In This Thread
cimulator - collision detection and physics simulation - by codectile - 25.11.2015, 15:25
Re: cimulator - collision detection and physics simulation - by Pottus - 25.11.2015, 15:29
Re: cimulator - collision detection and physics simulation - by codectile - 25.11.2015, 15:44
Re: cimulator - collision detection and physics simulation - by Stanford - 03.12.2015, 15:34
Re: cimulator - collision detection and physics simulation - by SkittlesAreFalling - 03.12.2015, 15:37
Re: cimulator - collision detection and physics simulation - by codectile - 03.12.2015, 18:08
Re: cimulator - collision detection and physics simulation - by TwinkiDaBoss - 03.12.2015, 19:01
Re: cimulator - collision detection and physics simulation - by codectile - 04.12.2015, 01:54
Re: cimulator - collision detection and physics simulation - by Crayder - 04.12.2015, 03:03
Re: cimulator - collision detection and physics simulation - by codectile - 04.12.2015, 03:45
Re: cimulator - collision detection and physics simulation - by Crayder - 04.12.2015, 04:38
Re: cimulator - collision detection and physics simulation - by codectile - 04.12.2015, 11:44
Re: cimulator - collision detection and physics simulation - by Stanford - 04.12.2015, 12:28
Re: cimulator - collision detection and physics simulation - by Cypress - 05.12.2015, 19:57
Re: cimulator - collision detection and physics simulation - by DRIFT_HUNTER - 05.12.2015, 20:50
Re: cimulator - collision detection and physics simulation - by codectile - 06.12.2015, 03:48
Re: cimulator - collision detection and physics simulation - by Crayder - 06.12.2015, 14:46
Re: cimulator - collision detection and physics simulation - by codectile - 06.12.2015, 16:13
Re: cimulator - collision detection and physics simulation - by Crayder - 06.12.2015, 19:09
Re: cimulator - collision detection and physics simulation - by codectile - 07.12.2015, 01:48
Re: cimulator - collision detection and physics simulation - by iWhite - 07.12.2015, 13:12
Re: cimulator - collision detection and physics simulation - by Stanford - 07.12.2015, 13:49
Re: cimulator - collision detection and physics simulation - by Romz - 07.12.2015, 13:52
Re: cimulator - collision detection and physics simulation - by Crayder - 07.12.2015, 16:03
Re: cimulator - collision detection and physics simulation - by codectile - 07.12.2015, 17:03
Re: cimulator - collision detection and physics simulation - by Romz - 09.12.2015, 14:30
Re: cimulator - collision detection and physics simulation - by codectile - 10.12.2015, 09:17
Re: cimulator - collision detection and physics simulation - by Riddick94 - 16.12.2015, 20:53
Re: cimulator - collision detection and physics simulation - by DRIFT_HUNTER - 16.12.2015, 22:06
Re: cimulator - collision detection and physics simulation - by codectile - 17.12.2015, 02:18
Re: cimulator - collision detection and physics simulation - by DRIFT_HUNTER - 17.12.2015, 06:59
Re: cimulator - collision detection and physics simulation - by Stanford - 31.12.2015, 16:10
Re: cimulator - collision detection and physics simulation - by codectile - 31.12.2015, 17:32
Re: cimulator - collision detection and physics simulation - by Stanford - 31.12.2015, 18:12
Re: cimulator - collision detection and physics simulation - by codectile - 01.01.2016, 05:09
Re: cimulator - collision detection and physics simulation - by Romz - 03.01.2016, 16:11
Re: cimulator - collision detection and physics simulation - by codectile - 03.01.2016, 16:26
Re: cimulator - collision detection and physics simulation - by Stanford - 03.01.2016, 16:32
Re: cimulator - collision detection and physics simulation - by Romz - 03.01.2016, 17:55
Re: cimulator - collision detection and physics simulation - by Sublime - 04.01.2016, 12:16
Re: cimulator - collision detection and physics simulation - by codectile - 04.01.2016, 12:34
Re: cimulator - collision detection and physics simulation - by Stanford - 06.01.2016, 03:51
Re: cimulator - collision detection and physics simulation - by Crayder - 06.01.2016, 04:23
Re: cimulator - collision detection and physics simulation - by Stanford - 06.01.2016, 04:54
Re: cimulator - collision detection and physics simulation - by Crayder - 06.01.2016, 05:13
Re: cimulator - collision detection and physics simulation - by codectile - 06.01.2016, 12:29
Re: cimulator - collision detection and physics simulation - by Stanford - 06.01.2016, 18:51
Re: cimulator - collision detection and physics simulation - by codectile - 07.01.2016, 08:46
Re: cimulator - collision detection and physics simulation - by Stanford - 07.01.2016, 10:00
Re: cimulator - collision detection and physics simulation - by tungki - 07.01.2016, 13:18
Respuesta: Re: cimulator - collision detection and physics simulation - by ipsBruno - 30.03.2016, 07:22
Re: cimulator - collision detection and physics simulation - by codectile - 30.03.2016, 09:10
Respuesta: Re: cimulator - collision detection and physics simulation - by ipsBruno - 30.03.2016, 12:57
Re: Respuesta: Re: cimulator - collision detection and physics simulation - by Crayder - 30.03.2016, 14:34
Respuesta: Re: Respuesta: Re: cimulator - collision detection and physics simulation - by ipsBruno - 30.03.2016, 15:34
Re: Respuesta: Re: Respuesta: Re: cimulator - collision detection and physics simulation - by Crayder - 30.03.2016, 16:07
Re: cimulator - collision detection and physics simulation - by Finn - 30.03.2016, 19:11
Re: cimulator - collision detection and physics simulation - by codectile - 03.04.2016, 15:50
Re: cimulator - collision detection and physics simulation - by Pottus - 03.05.2016, 01:09
Re: cimulator - collision detection and physics simulation - by AIped - 03.05.2016, 08:05
Re: cimulator - collision detection and physics simulation - by Sanady - 03.05.2016, 09:55
Re: cimulator - collision detection and physics simulation - by Sanady - 03.05.2016, 09:59
Re: cimulator - collision detection and physics simulation - by codectile - 03.05.2016, 10:47
Re: cimulator - collision detection and physics simulation - by Sanady - 03.05.2016, 11:31
Re: cimulator - collision detection and physics simulation - by codectile - 03.05.2016, 12:10
Re: cimulator - collision detection and physics simulation - by VAWYLoN - 14.05.2016, 03:26
Re: cimulator - collision detection and physics simulation - by Crayder - 16.05.2016, 13:19
Re: cimulator - collision detection and physics simulation - by VAWYLoN - 17.05.2016, 08:47
Re: cimulator - collision detection and physics simulation - by codectile - 24.06.2016, 08:48
Re: cimulator - collision detection and physics simulation - by Crayder - 24.06.2016, 19:59
Re: cimulator - collision detection and physics simulation - by usersamp - 05.08.2016, 12:44

Forum Jump:


Users browsing this thread: 6 Guest(s)