XanderRutan Posted July 22, 2020 Posted July 22, 2020 Hi, I created a giant wave for surfing. This wave advances correctly with the llSetKeyframedMotion function. But when I get on the wave, instead of being pushed by the prim, I cross the prim (although it isn't declared as a ghost prim)
VirtualKitten Posted July 26, 2020 Posted July 26, 2020 Hi you said "I crossed the prim ?" what did you mean and ghost prim do you mean physical? finally the criteria of llSetKeyFrameMotion is as follows have a look at point two emboldened, be safe Caveats This function does not work in attachments. This function can only be called on NON-physical objects. In the future it could be extended to support physical objects, but this is more complicated as collisions could prevent the object from reaching its goal positions on time. You cannot use scripts to move any prim in the linkset while the keyframed motion is active. If you must, first pause and restart it with KFM_CMD_PLAY when done. #Example Collisions with avatars affect the angular movement of the object and it may not reach the final rotation. This function can only be called on the root prim of a linkset. This function requires the linkset to use the Prim Equivalency system. However, it keyframed objects will not receive the dynamics penalty and can have a physics weight of up to 64. llSetKeyframedMotion is implemented in terms of frames and not real time. To avoid a drift from the expected positions and rotations, use times which are integer multiples of 1/45, e.g. 20.0/45.0, 40.0/45.0, 90.0/45.0, etc. Forum Thread KFM claims delta times must be larger than 0.1 seconds; in practice, however, delta times slightly over 0.1 will produce an error on DEBUG_CHANNEL. Testing shows a minimum delta time is about 6/45 (.13333) seconds. Natural drift can still occur; for best results use moving_end to determine when the animation has ended and confirm the target position with llSetPos. Or you can use at_target or at_rot_target. There are a few bugs in the avatar animation system that may cause strange looking animations to play when standing on a moving platform (e.g., walking in place, feet-at-pelvis). We hope to fix these in the future, but doing so is out of scope for this feature. As with dynamic objects, objects moving using this function are paused when they are selected by an avatar with adequate permissions (object owner, passenger, etc). When such an avatar deselects the object, motion resumes, even if the object had been paused using KFM_CMD_PAUSE. A Key Framed Motion is a prim property in some respect. When a KFM_LOOP or KFM_PING_PONG is initiated the the motion is preserved after the script is removed. I.E. The prim will continue what motion it had. It will survive take and copy. It will survive server restart. Inter region movement is far from perfect. Crossing from sim 1 to sim 2 using a Key Frame list with numerous frames on a curved path will pick up conspicuous errors on the crossing and when reversed by [ KFM_MODE, KFM_REVERSE ] the object will stay in sim 2 and never return to sim 1 All Issues ~ Search JIRA for related Bugs
XanderRutan Posted July 26, 2020 Author Posted July 26, 2020 Thx VirtuaKitten, My initial wish is to use a realistic mesh for the wave. As I was crossing the wave, I thought the problem was with the mesh. So I tried with only one prim. (A simple half-cylinder that I hollowed out at 90 %) But the problem is the same with a prim. When I arrive on the wave with my surfboard, I cross it! The wave script is as follows (simplified presentation) The wave begins to move forward with a click of the mouse. default { state_entry() { llSay(0, "Script running"); } touch_start(integer num_detected) { llSetKeyframedMotion([<200, 0.0, 0.0>, 40],[KFM_DATA, KFM_TRANSLATION]); } } For a simple visual effect, this script is perfect, as the wave moves linearly like a vehicle. But for surfing it isn't suitable.
Mollymews Posted July 26, 2020 Posted July 26, 2020 it has always been a bit murky when attempting to push a physical object with a KFM-enabled object. KFM is a primarily a client side effect, the KFM object can get out of sync and be in a different place on our viewer screen to where our server side script expects it to be for myself personally I find that the best waves to surf are physical and use llMoveToTarget to achieve visually smooth travel and do not have scripted collision events in the wave object. In the surfboard only use collision_start and collision_stop to trigger stand/sit avatar rider status changes typically
XanderRutan Posted July 26, 2020 Author Posted July 26, 2020 Thanx Mollymews llMoveToTarget works well for my giant wave. The collision with my surfboard is done correctly. I had used this function to animate fish, but forgot about it. 1
Wulfie Reanimator Posted July 27, 2020 Posted July 27, 2020 (edited) 8 hours ago, Mollymews said: it has always been a bit murky when attempting to push a physical object with a KFM-enabled object. KFM is a primarily a client side effect, the KFM object can get out of sync and be in a different place on our viewer screen to where our server side script expects it to be for myself personally I find that the best waves to surf are physical and use llMoveToTarget to achieve visually smooth travel and do not have scripted collision events in the wave object. In the surfboard only use collision_start and collision_stop to trigger stand/sit avatar rider status changes typically The term "physical" is a bit weird in this context. KFM works just fine for non-phantom objects. It's not just a client-side effect. "Physical" means objects that have the little physics-checkbox enabled, which makes them react to things like gravity. KFM objects which are non-phantom will push/carry avatars and physical objects. https://gfycat.com/happyhardtofindauk Edited July 27, 2020 by Wulfie Reanimator
Mollymews Posted July 27, 2020 Posted July 27, 2020 7 hours ago, Wulfie Reanimator said: The term "physical" is a bit weird in this context. KFM works just fine for non-phantom objects. It's not just a client-side effect. "Physical" means objects that have the little physics-checkbox enabled, which makes them react to things like gravity. KFM objects which are non-phantom will push/carry avatars and physical objects. https://gfycat.com/happyhardtofindauk yes is does, is just that I find that when we remain stationary then it works ok. When we move quickly at different angles like on a surfboard then at times we can pop thru and out the back of the wave
Wulfie Reanimator Posted July 27, 2020 Posted July 27, 2020 1 hour ago, Mollymews said: yes is does, is just that I find that when we remain stationary then it works ok. When we move quickly at different angles like on a surfboard then at times we can pop thru and out the back of the wave In that case it's a simple matter of making sure the object isn't too thin for the relevant velocities. It's no different from any other physics problem, MoveToTarget won't change anything. speed / 45 = thickness (minimum) So, if you're on a surfboard going 30m/s and the wave is coming at you 20m/s, the object needs to be at least 50/45(= 1.111) meters thick, or you risk going straight through it.
Mollymews Posted July 27, 2020 Posted July 27, 2020 7 minutes ago, Wulfie Reanimator said: In that case it's a simple matter of making sure the object isn't too thin for the relevant velocities. It's no different from any other physics problem, MoveToTarget won't change anything. yes is all true about frame rates and thin/thickness using llMoveToTarget instead of KFM did change something for Xander tho. Xander's wave worked as Xander expected. KFM didn't work for Xander as Xander expected it too. I am the same as Xander. I go with what works 1
Recommended Posts
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