Talk:Physics Entity Overview

From Valve Developer Community
Jump to: navigation, search

Just updated a couple of these descriptions for these reasons: phys_constraintsystem is not about performance, it's about stability of the interactions between constraints. phys_convert is only useful for converting an entity with some other behavior. For totally static stuff that you want to be physical later, you should use prop_physics or func_physbox with motion disabled, then trigger an EnableMotion input to make them physical. Also the previous description referred to prop_static which is not a real entity (it's equivalent to world geometry) and cannot be acted upon by any entity I/O so phys_convert cannot target one of those.

I would be a lot happier using motion disable if it also disabled the grav. gun playing the primary fire sequence when you try to punch the prop. Is that going to be fixed? Thanks. --TomEdwards 12:09, 28 Jul 2005 (PDT)
There aren't any plans to change this. It's easy enough to do in a mod though - you just have to make sure to check for the "motion enable on physcannon" behavior --Jay Stelly 15:47, 28 Jul 2005 (PDT)

I'm probably being really stupid here, but is there any way of connecting two physics props together with a variable-length rope? Something like a crane would be great, connecting a func_tracktrain to a prop_physics with the ability to change length depending on input. While still acting like a realistic pendulum. Any ideas? --Cargo Cult 12:22, 22 Sep 2005 (PDT)

Would faking it be acceptable? If so, you could hang a func_movelinear from a phys_ballsocket. It's rigid-body motion, so the pendulum equations wouldn't apply, but the movement of an attached rope might look reasonable to someone who isn't studying it in detail. —Maven (talk) 12:40, 22 Sep 2005 (PDT)
Until I read this question, I never knew what precisely the phys_pulleyconstraint was for. =D --Demented 13:21, 22 Sep 2005 (PDT)

Doh! Once again, I find the most difficult way to do the task. —Maven (talk) 13:32, 22 Sep 2005 (PDT)

Except the pulley thing isn't right - it's for hanging two objects from fixed points in space, rather than from a location attached to a moving crane jib, for example. The closest examples I've found in Valve maps seem to have pendulums of fixed lengths but with the fulcrums moving up and down - they don't swing too much so it's not too obvious that it's faked.
Argh. I think I'll have to just turn this thing into a crude battering ram instead. :-] --Cargo Cult 13:42, 22 Sep 2005 (PDT)

Think more innovatively. :p If you take two objects and pretend one of them doesn't exist (it's the control object), what you have is an object, a thread, and the eye of a needle. That's all you need for a variable-length constraint. To increase the length of the "rope", move the control object closer to the pulley. --Demented 13:51, 22 Sep 2005 (PDT)

The pulley constraint doesn't have a 'parent' keyvalue, so the "eye of a needle" can't move around, it seems. —Maven (talk) 14:09, 22 Sep 2005 (PDT)

speaking of parent keyvalues....all ents support a parent....—ts2do (Talk | ›) 16:03, 9 Nov 2005 (PST)

What? No they don't. Try parenting a pulley sometime. —Maven (talk) 18:41, 9 Nov 2005 (PST)

theoretically all CBaseEntity based ents have parents—ts2do (Talk | ›) 19:22, 9 Nov 2005 (PST)

  • Just in case someone is still wondering how to do this: a phys_spring with a high spring constant and damping factor, and the "force only on stretch" flag set, behaves just like a rope. You can give it a SetSpringLength input to change its length, too. --Rof 12:51, 10 Feb 2006 (PST)

When creating a pulley in the code, you use a constraint_pulleyparams_t object, which has (among other objects) 2 pulleyPosition vectors and 2 objectPosition vectors. Based on the comments in the code, I'm guessing the pulleyPositions are the location for the 2 pulleys and the objectPositions are the vectors for the 2 objects being connected. I'm having alot of trouble creating the pulley correctly. I think it is due to how I am setting the objectPosition (using GetAbsOrigin() on the entity). Does anyone know the proper way to set objectPosition? --Daktor 21:28, 12 Jun 2006 (PST)