[Include] [alpha] Objects Physics - Handle objects collisions and more.
#61

I think I should consider doing another test maybe tomorrow or after tomorrow!
Thanks Crayder.
Reply
#62

I have released a better version of Pool game:
https://sampforum.blast.hk/showthread.php?tid=600413
Reply
#63

Very nice plugin, which creates multiple possibilities. Can you add a default support for Incognitos Streamer (for CreateDynamicObject) ?

Edit: Ah, some people already argumented that Streaner would be too slow.
Reply
#64

Quote:
Originally Posted by PeppeAC
Посмотреть сообщение
I have released a better version of Pool game:
https://sampforum.blast.hk/showthread.php?tid=600413
Update the ColAndreas

https://sampforum.blast.hk/showthread.php?tid=586068

Use foreach instead y_iterate

https://github.com/Misiur/YSI-Includes

And improve the object pyhysics soon
Reply
#65

Quote:
Originally Posted by eco1999
Посмотреть сообщение
He doesn't need to do anything to update ColAndreas. It's completely on the user's end.

Quote:
Originally Posted by eco1999
Посмотреть сообщение
Use foreach instead y_iterate

https://github.com/Misiur/YSI-Includes
I think you meant to say "use y_iterate instead foreach". In my opinion, this too should be up to the user.
@PeppeAC you should just verify either foreach or y_iterate were included. They both have definitions for this. They both have the same exact functions. One is more recently updated than the other, y_iterate.

Quote:
Originally Posted by eco1999
Посмотреть сообщение
And improve the object pyhysics soon
How exactly do you think they can be improved?
Reply
#66

Quote:
Originally Posted by Crayder
Посмотреть сообщение
He doesn't need to do anything to update ColAndreas. It's completely on the user's end.



I think you meant to say "use y_iterate instead foreach". In my opinion, this too should be up to the user.
@PeppeAC you should just verify either foreach or y_iterate were included. They both have definitions for this. They both have the same exact functions. One is more recently updated than the other, y_iterate.



How exactly do you think they can be improved?
Bug or something like that.
Reply
#67

I get argument warning in this line in this include:

Код:
CA_RayCastLineAngle(x, y, z, x, y, z - 1000.0, unused, unused, bound);
Colandreas inc.:

Код:
native CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz);
Reply
#68

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
I get argument warning in this line in this include:

Код:
CA_RayCastLineAngle(x, y, z, x, y, z - 1000.0, unused, unused, bound);
Colandreas inc.:

Код:
native CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz);
+++1
Reply
#69

Could this include handle objects that's hinged to a surface?
For example, a pole falling over, or do physics apply only to objects that are indipendent?
Reply
#70

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
I get argument warning in this line in this include:

Код:
CA_RayCastLineAngle(x, y, z, x, y, z - 1000.0, unused, unused, bound);
Colandreas inc.:

Код:
native CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz);
Remove "Angle", leave everything up to it.
Reply
#71

Hi, i'm trying to make a basic drop/loot system with ColAndreas and this include. I used Peppe's example to make a function that creates an onbject to throw. If I use the function CreateObject (native) it works perfectly, but if use the streamer of ColAndreas or Incognito's streamer the object spawns, but it doesn't move. I need to use streamer due to objects limit. Any solution?
Код:
public DropInventoryItem(playerid, modelid)
{
	#define SPEED 	(10.0)
	#define Z_SPEED (4.0)
	#define GRAVITY (13.0)
	
        new Float:posx, Float:posy, Float:posz, Float:posa;		
	GetPlayerPos(playerid, posx, posy, posz);
	GetPlayerFacingAngle(playerid, posa);
		
	Streamer_Update(playerid);
	new obj = CA_CreateDynamicObject_DC(modelid, posx, posy - 0.5 * floatcos(-(posa + 90.0), degrees), posz, 93.7, 120.0, posa + 60.0, -1, -1, -1, 300.0, 300.0);
		
	PHY_InitObject();
	PHY_UseColAndreas(obj, 1);
	PHY_SetObjectVelocity(obj, SPEED * floatsin(-posa, degrees), SPEED * floatcos(-posa, degrees), Z_SPEED);
	PHY_SetObjectFriction(obj, 100);
	PHY_SetObjectGravity(obj, GRAVITY);
	ApplyAnimation(playerid, "GRENADE", "WEAPON_throwu", 3.0, 0, 0, 0, 0, 0);
	return 1;
}
Reply
#72

Quote:
Originally Posted by VincenzoDrift
Посмотреть сообщение
Hi, i'm trying to make a basic drop/loot system with ColAndreas and this include. I used Peppe's example to make a function that creates an onbject to throw. If I use the function CreateObject (native) it works perfectly, but if use the streamer of ColAndreas or Incognito's streamer the object spawns, but it doesn't move. I need to use streamer due to objects limit. Any solution?
Код:
public DropInventoryItem(playerid, modelid)
{
	#define SPEED 	(10.0)
	#define Z_SPEED (4.0)
	#define GRAVITY (13.0)
	
        new Float:posx, Float:posy, Float:posz, Float:posa;		
	GetPlayerPos(playerid, posx, posy, posz);
	GetPlayerFacingAngle(playerid, posa);
		
	Streamer_Update(playerid);
	new obj = CA_CreateDynamicObject_DC(modelid, posx, posy - 0.5 * floatcos(-(posa + 90.0), degrees), posz, 93.7, 120.0, posa + 60.0, -1, -1, -1, 300.0, 300.0);
		
	PHY_InitObject();
	PHY_UseColAndreas(obj, 1);
	PHY_SetObjectVelocity(obj, SPEED * floatsin(-posa, degrees), SPEED * floatcos(-posa, degrees), Z_SPEED);
	PHY_SetObjectFriction(obj, 100);
	PHY_SetObjectGravity(obj, GRAVITY);
	ApplyAnimation(playerid, "GRENADE", "WEAPON_throwu", 3.0, 0, 0, 0, 0, 0);
	return 1;
}
You could just use CreateObject for these temporarily. Don't use the CA dynamic objects. Plus, there is a callback in this include for when objects collide with the CA world.

Use CreateObject.
Activate it's physics.
Wait for the world collided callback.
Get the objects information and add the drop.
Add the streamer object.
Destroy the object.
Deactivate it's physics.
Reply
#73

Thanks a lot
Reply
#74

How to make psysic object follow player and will by bouncing? it's for basketball system
Reply
#75

Quote:
Originally Posted by Billpilot
Посмотреть сообщение
Looks nice!
Lmao, are you posting in literally every thread saying it's nice just to get post count? For example if you scroll through the gamemodes page you can see that in almost every thread the last post was made by you.
Reply
#76

Im trying to use PHY_UseColAndreas(objectid, mode = 1) but it give me following error
C:\Users\Самп\Desktop\0.3.7\pawno\include\physics. inc(730) : error 017: undefined symbol "PHY_UpdateBounds"
Reply
#77

Why we can only use CreateObject? i have lot object on my gamemode wtf
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)