• index

    >>>> <$n:fileID>.md

    # Motion in Second Life

    A small book about making things move in Second Life.

    ## Licensing

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Li...

  • 0050-intro

    What this is, how it’ll go.

  • 0075-folder


    • some-topic

      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod

      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

      quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo

      consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse

      cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non

      proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    • a-bit-more-info

      Here’s some info we thought you should have as part of this section which we’re really just writing to give ourselves a sample of some stuff.


  • 0100-lets-make-things-move

    ## Let's move something

    The purpose of this little document is to describe one way of making objects “move” in Second Life. We’ll start from some basics and work our way up.

    ### How can things move in Second Life?

    There are at least five ways to make things move in Second Life.

    ### Physical objects

    Objects can use “physics”, an add-on to Second Life which simulates the physics of the real world. Using physics, you can apply forces to an object to make it move around. There are settings to ...

  • 0200-improvement-1

    Physical, Vehicles, SetPos. We’ll do the last one.

  • 0300-first-refactoring

    As we go through these examples, we’ll be emphasizing finding simple solutions, then improving them along the dimensions we care about. Don’t try to bite off the whole problem. Take small bites and chew them carefully.

  • 0400-smoother

    Let’s move back and forth. First llSetPos, then llSLPPF.

  • BELOW HERE IS DRAFTY

    This is just some text we’re typing in.

    It looks double spaced.

    This still looks double spaced

    Now it isn’t double spaced

  • 0600-the-question-of-paths

    So in our little program, we have a path from XYZ to X’Y’Z’. We’ll have the problem of representing paths. Before we go too far, though, let’s learn some more basics.

  • 0700-forming-our-first-script

    Maybe we should build up our first script incrementally?

  • 0800-jump-script

    ## First script: Popping back and forth.

    Here’s our script. It’s far more elaborate than is really needed for this simple example, but I want to go over all the details as they’ll matter in the future.

    // back-and-forth-jump

    // JR 2018-05-21

    // Just jumps <2,1,0> and back, repeatedly.

    integer Running = FALSE;

    vector Home;

    vector Jump = <2,1,0>;

    vector Pos;

    start_running() {

    Home = llGetPos(); // in case we've been moved.

    Pos = Home;

    llSetTimerEvent(1.0);

    }

    stop_running() {

    Pos = Home;...

  • 0900-jump-script-params

    Now I hope you ran the preceding script. If you did, you probably noticed that SL makes it look as if the little cube moves smoothly from place to place. That’s called “tweening” and usually SL makes it look pretty good. However, it goes pretty fast and we really would like our object to move a bit slower, so in our next example, we’ll move incrementally.

    But first we need to do something more complicated: llSetLinkPrimitiveParamsFast(). Maybe I’ll call that llSLPPF or Params Fast sometimes. The...

  • 1000-refactoring

    change move to call adjust position and set position, combined method?

    what else needs cleaning?

  • 1100-the-timer

    why do we do this?

  • 1200-moving-incrementally

    start by refactoring to start-end? do refactoring right along?

  • 1300-tracing-a-circle

    Suppose we want our object to go around a circle. How can we calculate XYZ around a circle? Solve triangles, or use r,theta.

  • 1400-representing-a-path

    lines and arcs? A little language.

  • 1500-what-about-following-the-curve

    Our little cube goes around, but it doesn’t follow the curve by rotating. Let’s fix that. Set rotation angle + something. Theta*baseRot?

  • 1600-where-do-these-lines-and-arcs-come-from

    Sensing a track. Tracing a track to embed. Or a notecard.

  • 1700-pros-and-cons-for-paths

    Embedded takes 2x the storage! Digress to read a notecard.

  • 1800-issues-with-sensing

    A straight in front of you is easy enough to sense. An arc’s center is way off to the side. Sharp curves hard to sense.

  • 1900-line-representation

    (a,b) then (b,c) then (c,d) vs just b -> c -> d

  • 2000-but-arcs

    How do arcs fit into this scheme? Radius and delta-theta (from current angle?) Where does this go?

  • 2100-what-about-using-only-straight

    A curve is really just a bunch of tiny straight moves anyway: note we moved straight between points. Extend that distance?

  • 2200-looks-like-jerking

    Now the orientation of the locomotive seems to shift jerkily. The linear straight motion might not be noticeable but the angle sure is. Slerp!

  • 2300-what-about-speed

    If we only move distance d on every tick, speed looks constant. How can we calculate d for various Line and Arc elements?

  • 2400-note-consider-never-doing-arc

    Perhaps approximations are the thing right along. Curve = lots of straights.

  • 250-representing-end-positions-on-a-segment

    Start/End. But prims have a center. Sensing section?

  • 2600-points-on-a-circle

    Degrees and Radians

  • 2700-moving-on-a-timer

    Each tick, some variable needs to move from end to end, or zero to 1, or something. 0 to 1 might be a good representation.

  • 2800-synchronizing-things

    Follower objects. Pure time. Read distance.

  • 2900-region-boundaries

    Difficult problem. Here’s what we know.