Detecting if a point is inside a solid

Avatar
Soundlogic
169 Posts
Posted Jun 19, 2011
I was wondering how I would detect if a point is inside a solid physics entity or brush, or physics clip, or such.
Thank You,
Sound Logic
Advertisement
Registered users don’t see ads! Register now!
Avatar
Kasc
77 Posts
Posted Jun 19, 2011
Replied 2 hours later
Bit vague, can you explain what you're trying to do so we can tell you the best thing to do?
Avatar
ChickenMobile
2,460 Posts
Posted Jun 19, 2011
Replied 1 minute later
What kind of point? A point entity?
All I can think of is using a trigger that has a filter.
Avatar
Soundlogic
169 Posts
Posted Jun 19, 2011
Replied 48 minutes later
I am trying to setup a catapult cube that when placed upside-down it will detect the floor and launch itself. However I need to detect solid brushes for this.
Thank you,
Sound logic
Avatar
ChickenMobile
2,460 Posts
Posted Jun 19, 2011
Replied 12 minutes later
Like I said, use a trigger with a filter of a block that is parented to the cube. When the (invisible) brush touches the trigger it will fire the catapult.
Avatar
Kasc
77 Posts
Posted Jun 19, 2011
Replied 2 minutes later
You would get issues where when the cube is rolling on the floor it would also activate the trigger. You could perhaps use a timer to activate the catapult after say 0.5 seconds. If the block leaves the trigger then you could deactivate the timer.
Avatar
yohoat9
274 Posts
Posted Jun 19, 2011
Replied 53 minutes later

Kasc wrote:
You would get issues where when the cube is rolling on the floor it would also activate the trigger.

A cube rolling? Seems as if havok has some problem, lol.

Avatar
Kasc
77 Posts
Posted Jun 19, 2011
Replied 4 minutes later

yohoat9 wrote:
Kasc wrote:

You would get issues where when the cube is rolling on the floor it would also activate the trigger.

A cube rolling? Seems as if havok has some problem, lol.

:wink:

Rolling is actually just rotation + translation, which is certainly possible for a cube.

Avatar
Soundlogic
169 Posts
Posted Jun 19, 2011
Replied 2 minutes later
I fail to see the proposed problem with the cube rolling, since that should activate the trigger. However, I am confused as how I use a filter to detect solid brushes. What settings would I use for the filter?

EDIT: I have been looking at the wiki, and would the class 'solid' work with the filter class?

Avatar
msleeper
4,136 Posts
Admin
Posted Jun 19, 2011
Replied 6 hours later
The class is the entity type, IE prop_weighted_cube. You would want to use filter_activator_name since this is a special cube with a unique name, and not all weighted cubes.
Avatar
Soundlogic
169 Posts
Posted Jun 19, 2011
Replied 15 minutes later
I'm confused. I'm trying to detect world brushes, which it says are under the class solid. I don't think they have names, so I don't see how filter name could work.
Avatar
msleeper
4,136 Posts
Admin
Posted Jun 19, 2011
Replied 10 minutes later

chickenmobile wrote:
Like I said, use a trigger with a filter of a block that is parented to the cube. When the (invisible) brush touches the trigger it will fire the catapult.

I'm assuming you are using this method?

Avatar
Soundlogic
169 Posts
Posted Jun 19, 2011
Replied 2 hours later
Oh. I was going for a more self contained method with the invisible block attached to the cube detecting the brushes that make up the world. Seemed more self contained and easier to drop into a map.
Avatar
msleeper
4,136 Posts
Admin
Posted Jun 19, 2011
Replied 8 minutes later
There is no way to do what you're trying to do. You need to fake it using the method that chickenmobile suggested.
Advertisement
Registered users don’t see ads! Register now!
Avatar
mbortolino
10 Posts
Posted Jun 20, 2011
Replied 7 hours later

Soundlogic wrote:
I'm confused. I'm trying to detect world brushes, which it says are under the class solid. I don't think they have names, so I don't see how filter name could work.

There's no trigger interaction for world brushes - they'd need to be func_brush or func_clip_vphysics with a name.

For your cube idea you could try parenting a thin trigger_multiple (or even the trigger_catapult itself if parenting works) to the cube, covering the relevant face (because parenting anything solid would make it glitchy). Give it a filter_activator_name for the entity 'cube_brushes'. Then cover any surface that your cube can touch with a func_clip_vphysics named 'cube_brushes' & give it an invisible texture.

The func_clip_vphysics can be solid only to the cube by using its filtername keyvalue, so you'd need another filter_activator_name that has the cube's name.