About Store Forum Documentation Contact



Post Reply 
Align object to grid
Author Message
DNS Offline
Member

Post: #1
Align object to grid
I create object like this
Game::World.objCreate(*objPoint, Matrix(objPoint->scale(), phys_hit.plane.pos ));

how to align it to grid?
07-19-2012 03:40 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #2
RE: Align object to grid
What I did was create it on a vector with integer coordinates.
Here's my code:

int i,j; .........
Game.World.objCreate(*flat, Matrix(flat->scale3(), Vec(j, 0, i)));

However, SOMETIMES, it doesn't seem to work. And I would like to ask someone more experienced WHY??? The world coordinates don't change now, do they? Sometimes when I place my block at those integer coordinates it gets "shifted" half a meter from the correct position, and results in lots of other glitches in my game.

Why would this happen?
09-04-2013 08:44 AM
Find all posts by this user Quote this message in a reply
Post Reply