prop_instance_intersects_with_prop_instance

正在查看此主题的用户

Phaiak

Knight
Only one stupid question (i already used the search function):
Has anybody used this operation with sucess? If yes, please Tell me how it works.
I just wrote this into a trigger, for two scene props (2x "spr_bed_a"):
插入代码块:
		(try_begin),
		  (prop_instance_intersects_with_prop_instance, "$test_instance1", "$test_instance2"),
		  (display_message,"@Collision_detected!"),
		(try_end),
But it did not work. The message was not shown when they intersect.
Any idea?
 
The body object for spr_bed_a is bo_bed_a, a manifold body. Collision detection between manifold bodies isn't implemented.
 
For your info, I would avoid any collision detections between a manifold and other object. It causes a lot of lag if used regularly.
 
Thank you!

Am i right when i think, that it is impossible to generate a detectable body out of a manifold body?
If yey, is there a  alternitive way? (except the moving of many invisible bodies with the scene prop)
 
The proper way would be to make a composite body object with capsules and spheres (= relatively inexpensive collision detection).
 
Thanks cmpxchg8b! This was realy helpful. My problem is solved. It works now.

(Could be interesting to know, how to edit the polygon-bodies...)
 
MadocComadrin 说:
What about planes? They're technically manifolds, but they shouldn't be that hard to calculate.
Tell me how you calculate collision to a plane. A sphere just needs to be checked for distance from center. A cylinder is checked for distance from radius along the length of the center line. Any kind of manifold becomes much more difficult to calculate. A plane would eliminate a dimension for one object, but not the other so it is still a 3d collision.
 
Err, you already answered the question when you described how to check collisions for a cylinder: you assume the center-line is zero in length. If the plain is square, you just do a quick polar transformation. Frankly, the polar transformation isn't bad at all. I don't see why they couldn't include rectangular prisms as well.
 
For Euclidean 2D to polar it's
x = r*cos(t)
y = r*sin(t)

Where r is the magnitude and t is the angle

For Euclidean 3D to Cylindrical it's
x = r*cos(t)
y = r*sin(t)
z = h

where z is the height.

 
后退
顶部 底部