Vruki Salet Posted July 20, 2006 Share Posted July 20, 2006 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 More sharing options...
Vruki Salet Posted July 21, 2006 Author Share Posted July 21, 2006 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 More sharing options...
razorace Posted July 21, 2006 Share Posted July 21, 2006 Yeah, getting both the cgame and game to work together is tricky for some of this stuff Good luck! Link to comment Share on other sites More sharing options...
Vruki Salet Posted July 21, 2006 Author Share Posted July 21, 2006 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 More sharing options...
ensiform Posted July 26, 2006 Share Posted July 26, 2006 whats the difference between strap_G2API_SetBoneAngles and trap_G2API_SetBoneAngles ? Link to comment Share on other sites More sharing options...
Vruki Salet Posted July 26, 2006 Author Share Posted July 26, 2006 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 More sharing options...
razorace Posted July 27, 2006 Share Posted July 27, 2006 Yep, that's the key reason why realistic IK is so difficult to pull off. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.