Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / how to disable 3d object collision?

Author
Message
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 3rd Aug 2023 04:12


SetObjectCollisionMode(1,0) does not work, my object is still having collision.
if objects is colliding with ground, the object will fall down so this is my problem.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 3rd Aug 2023 21:35
By default when you create a physics object it will apply the collision mode for you. Are you trying to turn collision off?


Automation on Steam now!
Score Table Jr. on Google Play!
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 09:36
@jd_zoo
Yes, I want to turn off the collision for a small character object.
When the small character object collide with the ground, the small character will fall down and roll over some 360 degrees.
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 12:13 Edited at: 4th Aug 2023 12:20
SetObject3DPhysicsFriction(2,0)
SetObject3DPhysicsRollingFriction(2,0)
SetObject3DPhysicsAnisotropicFriction (2,0)

this three commands also did not work.


SetObject3DPhysicsMaxLinearVelocity (2,1)
It just decreases the collision power from decreasing the Velocity, so this command has some effect.

Still not figured out, need help here.
How to turn off the collision between the dynamic object (a small 3d object) and the static ground plane.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Aug 2023 12:34 Edited at: 4th Aug 2023 13:34
i think you're looking for SetObject3DPhysicsGroupAndMask().

unfortunately, the help is not much help but i think it's bitwise collision masks which i've only used once (and, in 2D, for Liberator) so i'm not too comfortable explaining but my setup there:


basically, i have 6 different collision groups and a collision on/off when a given group interacts with another.

so, for example, the barricades... the player and enemies will colliide with them but the bullets pass through. and, everything collides with "objects" which are the buildings and trees in the game. player bullets don't collide with themselves nor enemy bullets and vice versa, but do collide with enemy tanks, etc.. when an enemy is destroyed, i change its collision mask (i think i make it a barrier vs enemy) so that it acts the way i want it.

i had some help from Scraggle when i was setting that up and i believe i understand the concept so sharing but i may not be 100%

again, that's 2D but i expect similar here. perhaps someone else can shed more light?

i'll try to find the mask stuff in the Source to see if there is more insight but you could play with the command and test, in the meantime.

add, a system like this may be more than you need as i'd call it entering into more advanced handling. if you simply want an object to stop interacting with the physics world, delete the physics body and move the object manually?

then:

do work. not sure why they are mentioned as part of the question but i also don't know what you expect from their use?
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 13:37 Edited at: 4th Aug 2023 13:41
The rebound power when a small object goes from sky to the ground, when it collides to the ground, the small object will be rolling over as the rebound power is strong.
I want to eliminate the rebound power but also keep the dynamic body.

@Virtual Nomad @jd_zoo
Thanks to Virtual Nomad and jd_zoo, your advices are very helpful too.

I am very sorry the title question is a little misleading that I just don't want the rebound power appears when they are colliding.
So SetObject3DPhysicsMaxLinearVelocity command is the closest solution but even setting SetObject3DPhysicsMaxLinearVelocity to 1, the rebound power of object is still not eliminated.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Aug 2023 13:43 Edited at: 4th Aug 2023 13:44
so you have 2 things going on? disabling collision + the rebound behavior?

re: the mask stuff, i don't have time ATM to go through it thoroughly but the (first) Ragdoll demo uses them. see the demos attached here.

meanwhile, let us know if the Mask stuff is useful here? i still want to learn more about it but if it shouldn't be a part of the thread, i won't pullute it with more info
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 13:58 Edited at: 4th Aug 2023 13:58
@Virtual Nomad
the mask(SetObject3DPhysicsGroupAndMask() ) functioning well.
When I set both object1 and object2 to group 1, they can collide with each other, when I set both object1 and object2 to different groups, they are not colliding and object2 with dynamicbody will fall down through the object2 with staticbody.
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 14:06
I am trying to go over Ragdoll demo,hope it could help me.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Aug 2023 14:23
OTW to work but check out all of the demos. ie, there are bouncing balls in some that may provide insight re: bouncing behavior or "rebound power"?

good luck. let us know what you discover
Yiu435
3
Years of Service
User Offline
Joined: 19th Dec 2020
Location:
Posted: 4th Aug 2023 15:27
I found a solution.



after using this code, the rebound behavior of object2 is disappeared.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 11th Aug 2023 00:34
Glad to hear you have something working, by the way with these commands:

Quote: "
SetObject3DPhysicsFriction(2,0)
SetObject3DPhysicsRollingFriction(2,0)
SetObject3DPhysicsAnisotropicFriction (2,0)
"


I believe would need to apply to both static and dynamic object, for example a ball rolling along a floor plane would need the SetObject3DPhysicsRollingFriction() command called for both objects for it to work.
Automation on Steam now!
Score Table Jr. on Google Play!

Login to post a reply

Server time is: 2024-11-08 23:37:10
Your offset time is: 2024-11-08 23:37:10