Jump to content

Need rotating object to remain physical.


Ava Royce
 Share

You are about to reply to a thread that has been inactive for 3292 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

My friend an I have spent the past couple of days working on a fun project. Yet, we've recently hit a snag. The object we've supplied with a rotation script isn't able to move people who stand in its way. Instead the object goes right through them, but it isn't suppose to do that. Is there anyway we can fix this? We tried making the said object physical, but as soon as it touched us it would fall over. 

P.S. I apologize in advance, if I posted this in the wrong forum.

Link to comment
Share on other sites

You may or may not want this object to be physical, but to explain what's going on: if you use llTargetOmega to make a non-physical object appear to rotate, that appearance is strictly a viewer-side effect, and in fact different folks looking at the same object will see it in different rotations depending on when it first came in view, client-side lag, and any number of other things.

As you observed, however, you can use that llTargetOmega function in a physical object and it will (try to) rotate server-side. This is massively laggy compared to the non-physical rotation -- but you're wanting to push avatars around, which is an inherently laggy operation. Anyway, you may get closer to what you want (or at least see better what's going on) by constraining the physical object so it can only spin on one axis, something like this:

default{    state_entry()    {        llSetStatus(STATUS_ROTATE_X, FALSE);        llSetStatus(STATUS_ROTATE_Y, FALSE);        llSetStatus(STATUS_PHYSICS, TRUE);        llTargetOmega(<0.0, 0.0, 1.0>, 0.5, 1.0);    }}

Now that's not how I'd actually do this. For most applications, you'd likely be better served with llSetKeyframedMotion() because it's (marginally) less compute-intensive and, more importantly, pushes around avatars and other physical objects without itself being pushed-back upon, which I'm guessing is more the effect you have in mind.

[ETA: You can also just use a constant succession of incremental llSetRot() or equivalent non-physical rotation-setting function calls to spin the object around and I'm pretty sure that will push avatars in its path, too, but that keeps the script constantly busy, so I'd avoid it myself.]

Link to comment
Share on other sites

In case it helps, here's a sample of how KFM might be used to push around an avatar:

integer STEPS = 36;float TIME_STEP = 0.2;default{    state_entry()    {        list rotTimeList;        float rotIncr = TWO_PI / (float)STEPS;        integer thisStep;        while (++thisStep < STEPS)            rotTimeList += [llEuler2Rot(<0.0, 0.0, rotIncr>), TIME_STEP];        llSetRot(ZERO_ROTATION);        llSetKeyframedMotion(rotTimeList, [KFM_MODE, KFM_LOOP, KFM_DATA, KFM_ROTATION]);    }}
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3292 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...