Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

GetTransform() costly?

Started by DarkZoulz Mar 25, 2006 at 12:08 AM 0 replies 750+ views
Original Post
DarkZoulz
DarkZoulz
Is it a heavy operation to get and set transformation matrices in D3D? I mean, can I throughout the engine use a device->GetTransform(D3DTS_WORLD, &matrix) to retrieve the world transform, or should I store it locally and get that copy every time I need it?
circlesoft
circlesoft
SetTransform() is pretty costly, as this entails a state change - GetTransform(), not so much. Remember that if you have a pure device, you can't use most IDirect3DDevice::Get*() calls. Generally, it is more flexible (and better design) to store the transforms yourself. Otherwise, you could be calling GetTransform() multiple times per frame, ect.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.