Ok, i have an object. It spawns another object at a certain Pos and Rot.
This works fine so long as the base object is not rotated (ie to position better in a room)
But lets say for positioning purposes, i want to rotate the base object around its Z axis some. Now my spawned object appear floating where the object use to be....
So, given the following.....
This is my poker table example.
deckPos is the location of the deck with the script in it, its a linked child of the main table.
nextPos is where i want the cards to appear on the table.
This works fine as is so long as the tables rotation is <0, 0, 90> and the decks rotation is <270, 0, 0>, then the following code will place the cards face down on the table at the position I wish. Again, the Deck is sitting on the Table, and is linked to the Table.
But if i rotate the table, then of course they are no longer where they should be.
So how do i need to change the below code to account for this?
CODE
rotation cardRot = ZERO_ROTATION;
vector eCardRot = ZERO_VECTOR;
vector nextPos = ZERO_VECTOR;
vector deckPos = llGetPos();
eCardRot = <90, 0, 0>;
eCardRot *= DEG_TO_RAD;
cardRot = llEuler2Rot( eCardRot );
nextPos = deckPos + <-1, 0, -0.01>;
llRezObject( "Player2Card", nextPos, ZERO_VECTOR, cardRot, y+1);
// The y+1 is used later to know which cards belong to which player