Jump to content

Home

Why can't bone angles be adjusted by value of variables??


Vruki Salet

Recommended Posts

I'm messing with setting bone angles in BG_G2PlayerAngles and a weird thing happens.

 

This doesn't work:

 

static vec3_t rhangAngle;
float p = 20.0f;

VectorCopy(vec3_origin, rhangAngle);
rhangAngle[PITCH] +=  p;

--snip irrelevant if(){} for being in a vehicle--

strap_G2API_SetBoneAngles(ghoul2, 0, "rhang_tag_bone", rhangAngle, BONE_ANGLES_POSTMULT, POSITIVE_X, NEGATIVE_Y, NEGATIVE_Z, 0, 0, time);

 

This does:

 

static vec3_t rhangAngle;
float p = 20.0f;

VectorCopy(vec3_origin, rhangAngle);
rhangAngle[PITCH] +=  20.0f;

--snip irrelevant if(){} for being in a vehicle--

strap_G2API_SetBoneAngles(ghoul2, 0, "rhang_tag_bone", rhangAngle, BONE_ANGLES_POSTMULT, POSITIVE_X, NEGATIVE_Y, NEGATIVE_Z, 0, 0, time);

 

See the only difference is in the first I added "p" (float value of 20.0) to rhangAngle[PITCH] and in the second I just added a float of 20.0 directly.

 

What gives?

Link to comment
Share on other sites

It turns out it was a problem involving the split between game and cgame and a failure of communication between them leading to my seeing something onscreen other that what the game was actually doing.

 

Anyone trying to deal with similar stuff is welcome to get in touch with me.

Link to comment
Share on other sites

Thanks I got it. I was sending the playerstate data to s in the wrong place or wrong way but it works now. It sure is tricky because it's hard to know if what you do doesn't work at all or if it works on the server but doesn't show on the client.

Link to comment
Share on other sites

You tell me, heh. It looks like all those strap_ commands just return equivalent trap_'s. It says they're "shared" but i see that the plain trap_'s are used in cgame and game so...? The reason client wasn't showing my changes was because the variable p was set just to 20.0f in game so cgame thought it was 0, while of course an actual number had its own real value whereever it was.

 

I was just setting angles directly in BG_G2PlayerAngles, not with traps. (No it wasn't obvious at first, i'm still taking baby steps here.) If you like to try wacky stuff with bone angles, check out the IK stuff in the game. You can sort of retroactively set bone angles to make a particular point on the body try to reach a given point in the game world. Restraining the joints to natural looking positions is hard though.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...