Game Development Community

How to divide float to integer values

by Alexander Bierbrauer · in Torque Game Builder · 05/12/2006 (10:17 am) · 1 replies

I know this is a stupid question,

but I don't know how to divide two float values to one integer result.

Example:

%fieldY = (%posY - $GAME::BLOCK_OFFSET_Y) / $GAME::BLOCK_SIZE;

%field gets something like XXX.025

Is there a simple operator, method or anything else to get around this problem ??

Thanx in advance,

Alex

#1
05/12/2006 (11:15 am)
You can use mFloor() and mCeil() to round floats down and up respectively.