adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] Map object thoughts


From: Kai Sterker
Subject: Re: [Adonthell-devel] Map object thoughts
Date: Thu, 14 Jun 2007 10:39:22 -0700

On 6/14/07, Andrew Phillips <address@hidden> wrote:

I'm gratified to know that I'm not the only one whose code segfaults. The
topic of map objects interests me, but I'm not sure I know what 'lazy
copying' is.

It basically means you keep a reference count for your object. Instead
of creating new instances of an object you point to the single
instance you have and increase the reference count. If parameters of
an object change that has a reference count > 1 you create a new copy
of that object and apply the changes to that, leaving all the other
objects that share the initial copy unchanged. I guess the term 'lazy
copying' refers to the fact that you don't create copies of objects
unless absolutely necessary (in contrast to using a separate copy of
each object right from the start).


As an example for 3-D, irregular bounding boxen: would a tree whose lowest
branches are ten feet off the ground need a bounding box that only describes
the trunk?

Probably yes. You could also separate trunk and the top of the tree
into two objects, each with their own bounding box.

Kai

P.S: After some more poking in the code and playing with the models
yesterday, I came to the conclusion to just use grid-sized objects for
now as anything larger isn't handled correctly. Then once the demo is
out, we can concentrate on fixing stuff. Otherwise the delay would be
just too big, I think. I will still go ahead and continue documenting
stuff as good as I can. Might be easier to fix things if we actually
understand how they work now (and how they are supposed to work) :-).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]