Instantiate inventory object rotated to rot with its root at position, moving at velocity, using param as the start parameter
void llRezAtRoot( string inventory, vector position, vector velocity, rotation rot, integer param );
Forced delay: 0.1 seconds. Energy: 200.0.
To rez an object so its center is at position (instead of the root) use llRezObject instead.
//Rez an object on touch
string object = "Object";//Object in inventory
integer start_param = 10;
rotation rot;
default
{
state_entry()
{
rot = llEuler2Rot(< 0, 90, 90> * DEG_TO_RAD);
}
touch_start(integer a)
{
vector vec = llGetPos() + < 0.0, 0.0, 5.0>; // 5 meter above this
vector speed = llGetVel();
llRezAtRoot(object, vec, speed, rot, start_param);
}
}
//Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.
string object = "Object"; // Name of object in inventory
vector relativePosOffset = <2.0, 0.0, 1.0>; // "Forward" and a little "above" this prim
vector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s
rotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this prim
integer startParam = 10;
default
{
touch_start(integer a)
{
vector myPos = llGetPos();
rotation myRot = llGetRot();
vector rezPos = myPos+relativePosOffset*myRot;
vector rezVel = relativeVel*myRot;
rotation rezRot = relativeRot*myRot;
llRezAtRoot(object, rezPos, rezVel, rezRot, startParam);
}
}
/*
NO COPY Rezzer Example by Daemonika Nightfire
Always rez the first object at touch, removing it from the content,
when the first one is removed, the next object automatically moves to the first position.
Content example:
object (no copy)
object 1 (no copy)
object 2 (no copy)
object 3 (no copy)
object 4 (no copy)
...
*/
vector relativePosOffset = <2.0, 0.0, 1.0>; // "Forward" and a little "above" this prim
vector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s
vector relativeRot = <90, 0, 0>; // Rotated 90 degrees on the x-axis compared to this prim
integer startParam = 10;
default
{
touch_start(integer a)
{
if(llGetInventoryNumber(INVENTORY_OBJECT) > 0) // checks if at least 1 object is present.
{
string object = llGetInventoryName(INVENTORY_OBJECT, 0); // name of the first object in inventory
vector myPos = llGetPos();
rotation myRot = llGetRot();
vector rezPos = myPos+relativePosOffset*myRot;
vector rezVel = relativeVel*myRot;
rotation rezRot = llEuler2Rot(relativeRot*DEG_TO_RAD)*myRot;
llRezAtRoot(object, rezPos, rezVel, rezRot, startParam);
}
else
{
llSay(0, "This rezzer is empty");
}
}
}