Re: [hlcoders] Simulated Animations

2006-02-14 Thread Meow Mew

Thanks for the suggestions.  It seems that there are a few things needing
clarification however, and I'm glad to answer you question and offer more
insight as to how my difficulty is set up.  Firstly, this is a singleplayer
mod (well, not a mod as we have liscencing, but close enough).

When I'm moving parts of the hand, I'm going to be using ragdoll and pushing
bones with forces.  This should avoid the traces altogether.  The collision
problem I'm having is just simply setting the unanimated model to follow my
player.  It's like if I were to attach a solid metal rod to my player and
walk around.  I'd expect it to knock things (prop_physics) over.  It does
not however, and I'm not entirely sure why.  My first guess is that it's
because I'm having to set the position to follow the player, and setting the
position is forcing a collision in a way the physics doesn't understand.
I'm not entirely sure how to fix this at all.

As for the viewmodel, I stated before that I have already researched the
viewmodel and am attempting to render my model in the exact same way as is.
The biggest difference is that the viewmodel has a client and a server
implementation, and my ragdoll does not.  Also, I could not over-ride the
CalcViewModelView function in my player because it is not a virtual function
and is called from base class pointers in view.cpp and hltvcamera.cpp.  It
is also called from ItemPostFrame, but this function is virtual and
overridden in my player class.  The other two functions call CalcView
directly before CalcViewModelView, so I overrode that function as well.
After all this is done, the following stutters, and I have no idea why.  It
follow correctly in a sense, just not smoothly.  I'm not sure if I need to
network my ragdoll, and if I do, why.

On 2/13/06, Aaron Schiff [EMAIL PROTECTED] wrote:


Is this a multiplayer mod?
When moving a part of the hand, you'll want to do traces, and see if that
action is actually possible ...if you want all movement to be possible, you
should research how the viewmodel is rendered and render it that way
(closer
on the z axis)


_
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Simulated Animations

2006-02-09 Thread Tim Holt
This and the vectorized aiming idea should get together - dynamic movement of a
player hand in a v_ model seem to go (pun intended) hand in hand.

Quoting Jay Stelly [EMAIL PROTECTED]:

  So you're suggesting to simply replace the RagdollBone() call
  with my own data transformations?

 yes

  When you are editing the matrix given back from
  GetBoneToWrite( boneIndex ), what is the scope of this
  matrix?

 It's just giving you a pointer to a matrix inside pBoneToWorld.  So the
 scope is the same as that data.

  Is it in local space covering only it's position and
  orientation from it's parent bone, or is it global space
  after concatenating all parents?  Basically, what does this
  matrix use for it's origin?

 It's a bone space to world space transform as the name implies.
 Concatenating a any parent transform is up to you.  Look at the code for
 BuildTransformations() and you can see this being done in the case of
 animation.  Ragdolls don't really have hierarchy so they just get the
 data directly from the physics simulation.

  I was looking through all the ragdoll code, and I was
  wondering since I need collision to occur in my model of the
  hand if I needed any other ragdoll code?

 For what it's worth, I probably wouldn't bother with collisions until
 you've got the other part working.  Anyway, that will make the problem a
 lot more complicated.

 If you want the physics system to solve the collisions, then you need to
 create physics objects for the various parts of the hand, yes.  The
 ragdoll code is probably the easiest way to do this provided you also
 want the constraints between the pieces.  It sounds like you don't - but
 I can't tell well enough from your description.

 The ragdoll system does not currently do all of the things you want.  I
 think you should probably use ragdolls plus what the bone followers use
 (shadow control), but since there is no code that currently does both I
 can't really say what problems you'll encounter.  You could also instead
 turn your user input into forces (basically what the vphysics shadow
 controllers do) in your own code as well.

  built and loaded with it's own collision data, but I'm not
  sure how well collision data will update if I manually move
  bone orientations around.

 You can do this, but instead of collisions you'll often get
 penetrations.  Better to push the bones in the direction of the desired
 position.

  I was searching and I couldn't
  even find how the physics told the ragdolls how to move in
  the first place.  Is it updated via the physics.dll behind
  the scenes completely?

 Look for physenv- in the client DLL.  The objects are created using
 that interface (physenv-CreatePolyObject()).  Then physenv-Simulate()
 gets called to advance time in the physics solver.  Then each object
 gets updated by reading through the interface returned by the create.

  I may even be going the wrong way with this.  Somebody else
  suggested I try using Bone Followers, but the Bone Follower
  update doesn't appear to do anything but update a shadow.  In
  fact, the Bone Follower code doesn't appear to do much at all.

 Hopefully you understand how that works a little better now.

  Also, related question but not of major importance as of yet.
   If I wanted to pick things up with this modeled hand, would
  the physics system be good enough?  Give friction and mass to
  all the fingers, then surround an object with the fingers,
  and lifting;  would that actually pick the object up, or
  would it need to be done some other way?

 I think it would basically work, but there will be a bunch of problems -
 oscillation/bouncing/shifting kinds of problems.  But then I've never
 tried it, so I can't say how serious those problems will be and I don't
 know what's acceptable to you.

 Jay

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders





___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Simulated Animations

2006-02-08 Thread Meow Mew

As I understand your question, you just want a bunch of bone
orientations to come from your code rather than a pre-defined animation.
That is exactly what the ragdoll code does, but the bulk of the code for
ragdolls is about doing the simulation; none of that is likely to be
useful for this purpose.

In reality, you should just look at how ragdolls override the animation
data in one function:

C_BaseAnimating::BuildTransformations()

this calls

m_pRagdoll-RagdollBone()

in the case of ragdolls.

If you hook this code in the same way, you can simply do a:
matrix3x4_t xform = pBoneToWorld-GetBoneForWrite( boneIndex );
and then put whatever transform you like into xform
then set
boneSimulated[boneIndex] = true;  // keeps the animation code from
overwriting your changes

for each bone that you want to replace.  That's it.

Jay


So you're suggesting to simply replace the RagdollBone() call with my own
data transformations?  Well, in theory that's simple enough.  I have a few
questions regarding that though.  Okay, a lot of questions, but I'd rather
get them all out now and save a lot of back and forth.

When you are editing the matrix given back from GetBoneToWrite( boneIndex ),
what is the scope of this matrix?  Is it in local space covering only it's
position and orientation from it's parent bone, or is it global space after
concatenating all parents?  Basically, what does this matrix use for it's
origin?

So if I need an arm and hand, with good natural physics/collisions with the
world around them, that I can re-orient the bones with, is just changing the
orientations as described above enough?  I'm trying to read as much of the
code as possible so I don't have any surprises.  The physics system is
something I haven't tackled yet, and time doesn't permit much with a bad
deadline.

I was looking through all the ragdoll code, and I was wondering since I need
collision to occur in my model of the hand if I needed any other ragdoll
code?  The model will be built and loaded with it's own collision data, but
I'm not sure how well collision data will update if I manually move bone
orientations around.  I was searching and I couldn't even find how the
physics told the ragdolls how to move in the first place.  Is it updated via
the physics.dll behind the scenes completely?  Where did the ragdoll objects
get piped to another library if this is true.  Does using CreatePolyObject()
create an object that updates it's data from the other DLL?  Summarizing,
where the ragdolls get their actual data or do the calculations to determine
the data to move the model accurately is beyond me at this point.

I may even be going the wrong way with this.  Somebody else suggested I try
using Bone Followers, but the Bone Follower update doesn't appear to do
anything but update a shadow.  In fact, the Bone Follower code doesn't
appear to do much at all.

Also, related question but not of major importance as of yet.  If I wanted
to pick things up with this modeled hand, would the physics system be good
enough?  Give friction and mass to all the fingers, then surround an object
with the fingers, and lifting;  would that actually pick the object up, or
would it need to be done some other way?

Thanks for everybody's input, and especially to Jay right now for getting me
started.

_
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Simulated Animations

2006-02-08 Thread Jay Stelly
 So you're suggesting to simply replace the RagdollBone() call
 with my own data transformations?

yes

 When you are editing the matrix given back from
 GetBoneToWrite( boneIndex ), what is the scope of this
 matrix?

It's just giving you a pointer to a matrix inside pBoneToWorld.  So the
scope is the same as that data.

 Is it in local space covering only it's position and
 orientation from it's parent bone, or is it global space
 after concatenating all parents?  Basically, what does this
 matrix use for it's origin?

It's a bone space to world space transform as the name implies.
Concatenating a any parent transform is up to you.  Look at the code for
BuildTransformations() and you can see this being done in the case of
animation.  Ragdolls don't really have hierarchy so they just get the
data directly from the physics simulation.

 I was looking through all the ragdoll code, and I was
 wondering since I need collision to occur in my model of the
 hand if I needed any other ragdoll code?

For what it's worth, I probably wouldn't bother with collisions until
you've got the other part working.  Anyway, that will make the problem a
lot more complicated.

If you want the physics system to solve the collisions, then you need to
create physics objects for the various parts of the hand, yes.  The
ragdoll code is probably the easiest way to do this provided you also
want the constraints between the pieces.  It sounds like you don't - but
I can't tell well enough from your description.

The ragdoll system does not currently do all of the things you want.  I
think you should probably use ragdolls plus what the bone followers use
(shadow control), but since there is no code that currently does both I
can't really say what problems you'll encounter.  You could also instead
turn your user input into forces (basically what the vphysics shadow
controllers do) in your own code as well.

 built and loaded with it's own collision data, but I'm not
 sure how well collision data will update if I manually move
 bone orientations around.

You can do this, but instead of collisions you'll often get
penetrations.  Better to push the bones in the direction of the desired
position.

 I was searching and I couldn't
 even find how the physics told the ragdolls how to move in
 the first place.  Is it updated via the physics.dll behind
 the scenes completely?

Look for physenv- in the client DLL.  The objects are created using
that interface (physenv-CreatePolyObject()).  Then physenv-Simulate()
gets called to advance time in the physics solver.  Then each object
gets updated by reading through the interface returned by the create.

 I may even be going the wrong way with this.  Somebody else
 suggested I try using Bone Followers, but the Bone Follower
 update doesn't appear to do anything but update a shadow.  In
 fact, the Bone Follower code doesn't appear to do much at all.

Hopefully you understand how that works a little better now.

 Also, related question but not of major importance as of yet.
  If I wanted to pick things up with this modeled hand, would
 the physics system be good enough?  Give friction and mass to
 all the fingers, then surround an object with the fingers,
 and lifting;  would that actually pick the object up, or
 would it need to be done some other way?

I think it would basically work, but there will be a bunch of problems -
oscillation/bouncing/shifting kinds of problems.  But then I've never
tried it, so I can't say how serious those problems will be and I don't
know what's acceptable to you.

Jay

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Simulated Animations

2006-02-07 Thread Jorge Rodriguez

Meow Mew wrote:


I normally wouldn't be asking on the mailing list as I like to resolve my
own issues.  This problem however, is a doozy.

We need to make an interface for a force feedback data glove. The
hardware
reading is all in place, and I've already completed piping in the new
hardware into the client.dll. The difficulty arises in how to control a
model of a hand and arm to accurately follow my data. Let me explain.

We have created a model that has all the neccesary bones to match up
to the
data glove. When I move the data gloves sensors for a thumb movement,
I need
to copy over the orientation into the model we're using in order to
let the
visual model have the exact same thumb movement. A virtual reality
simulated
hand is the concept.

Now, it's the tying in to the model data that I'm a bit wary of. I know I
could make it an animated prop, or derived thereof, but how can I
force the
bones to orient? I'm attempting to look at the ragdoll code, as a
controlled
form of ragdoll not using physics almost seems like what I want, but I'm
very unfamiliar with the ragdoll structures and data members. This
particular part of the Valve code seems less commented and readable than
others.

So does anybody have much familiarity with the ragdoll code, or
dynamically
controlling bones in any fashion? I'd very much appreciate any help or
suggestions.

Thanks


I don't know about in HL2, but in HL1 there was a source file called
StudioModelRenderer.cpp on the client that had code to set up a model's
bone information according to its animation. Although not many people
messed with this code much, it was actually possible to rewrite the code
to ignore a model's animation and position the model any arbitrary way,
for example to implement 9-way blending or perhaps integrate a ragdoll
engine. Looking around in the hl2sdk, I see some files that allow for
similar functionality, like studio.cpp and bone_setup.cpp, and although
I don't have much experience yet with that area of the SDK, that would
be the first place I would suggest you look.

--
Jorge Vino Rodriguez


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Simulated Animations

2006-02-07 Thread Jay Stelly
As I understand your question, you just want a bunch of bone
orientations to come from your code rather than a pre-defined animation.
That is exactly what the ragdoll code does, but the bulk of the code for
ragdolls is about doing the simulation; none of that is likely to be
useful for this purpose.

In reality, you should just look at how ragdolls override the animation
data in one function:

C_BaseAnimating::BuildTransformations()

this calls

m_pRagdoll-RagdollBone()

in the case of ragdolls.

If you hook this code in the same way, you can simply do a:
matrix3x4_t xform = pBoneToWorld-GetBoneForWrite( boneIndex );
and then put whatever transform you like into xform
then set
boneSimulated[boneIndex] = true;  // keeps the animation code from
overwriting your changes

for each bone that you want to replace.  That's it.

Jay

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders