realbasic-games
[Top] [All Lists]

Re: Animation and memory issue

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Animation and memory issue
From: Lo Saeteurn <realbasic at miensoftware dot com>
Date: Mon, 25 Jul 2005 09:14:26 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <FF3D4383-F5B1-4405-A67F-BDF52954811A at miensoftware dot com> <D52AC133-DDD0-4558-8725-9508D39F6E79 at chaoticbox dot com> <F29BF550-E17D-4DD4-B907-AD971BCB8823 at miensoftware dot com> <8F479F6E-AC0F-4117-8F81-68A68C3A43E1 at chaoticbox dot com> <DE4335D4-957D-49C7-86EC-C6304D6238FA at miensoftware dot com> <DCC3198F-BD3B-405D-B445-072E01D1716A at chaoticbox dot com> <4B8067F5-6CC8-4F99-80CA-74EC961FB1AB at miensoftware dot com> <40DAC1AB-9ADD-4DDF-B37D-C0E885B609D6 at chaoticbox dot com>
Object3D.Clone creates new (internal) display groups and adds references to each shape from the original object. So basically there's still only 1 trimesh, but it's got an extra reference for each clone (Quesa objects are reference counted just like RB's).

Replacing certain pointers with local memoryblocks may be a good idea anyway, since you can animate directly on your memoryblocks without digging through the trimeshes every time. You might want to take that approach further though, and build the trimeshes from scratch - that way you'll have total control over which memoryblocks are shared and which are unique.

When I change the pointers of the Points to reference to a local memoryblock of a cloned object, it seems to affect all because it is still sharing a single trimesh. So you're saying that I should rebuild the trimesh and point the UVs, textures, triangles, etc. to the original memoryblocks, but point the Points to a new memoryblock.

This seems like the only route I can take. It also doesn't look like I can use the Quesa wrappers to directly change the pointers. After looking though the trimesh code, I can see the offset of all the pointers so thanks for your help.


That's odd - the display group looks correct in your code, and I can't imagine how it could be responsible for something like that. There's likely a problem somewhere else, and it could just as easily be a bug in the Quesa Wrappers.

I found the problem. I forgot to change the shape for each level of detail; I left it 0.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>