How does a 'child' differ from an 'entity'?

Blitz3D Forums/Blitz3D Programming/How does a 'child' differ from an 'entity'?

puki(Posted 2006) [#1]
I'm just moving my way into Blitz animation.

I can take a .b3d file and find all the 'children'. However, exactly what can you do with a 'child'?

I found that I could not 'hide' one - so, when animating a .b3d, and trying to hide a child (using HideEntity) it just froze in place while the rest of the model animated. I cannot Alpha one as Blitz states the entity (child) is not a model.

I tried tracking children by using commands such as rhand#=EntityX(R_Hand), but Blitz gives some strange, static, numerical result for that (regardless of whether I am tracking it with floating point or integer values).


My next task will be to see if I can get collision detection with a specific child - I'm hoping that will work.

Anyways, are you meant to treat a child like an Entity?


skidracer(Posted 2006) [#2]
It depends on what type of Entity type the child is (see EntityType), if it is a pivot then EntityAlpha will fail, the hide behavior you are experiencing sounds more like a bug.

The position will be static if the animation is based on rotation, try using the global form of EntityX, EntityY and EntityZ if you want to see their positions relative to the world and not their immediate parent.


puki(Posted 2006) [#3]
Right, I'll get straight on it

Large.


EDIT:
I'm typing this before I burst with excitement - setting the Global value worked - Large!


Beaker(Posted 2006) [#4]
The command isn't EntityType(ent) its EntityClass(ent) and returns a string:
http://www.blitzbasic.com/b3ddocs/command.php?name=entityclass&ref=goto
NB. A bone is returned as a pivot.

A child is an entity. An entity isn't always a child.


puki(Posted 2006) [#5]
Great - thanks "Beaks". I've never used 'EntityClass' before. It's not in the original printed manual as far as I can see - I really do need to use the online docs.

I also have made a lot of progress by setting the 'recursive' value to 1 - I've never used it before - works a treat.


octothorpe(Posted 2006) [#6]
There's that word again, 'large'. Why are things so large in the future - is there a problem with the Earth's gravitational pull?


jfk EO-11110(Posted 2006) [#7]
dumb joke removed.

BTW. Is there a diffrence between children that are part of a hierarchy loaded using LoadAnimMesh and children that were parented to an entity using EntityParent?


big10p(Posted 2006) [#8]
Heavy.


puki(Posted 2006) [#9]
I haven't yet got child to child collisions (sourced from different entities) or child to specific entity collisions working properly - but I am working on it.

I somewhat feel the future of B3D is in my paws. I am the future.


jhocking(Posted 2006) [#10]
First off, a child is an entity. Specifically, a child is an entity that is linked to another entity.

Note however that there are several kinds of entities. Stuff like HideEntity and EntityAlpha only apply to meshes, one kind of entity. Another kind of entity is a pivot (essentially, an infinitely small point.) The bones of skeletal animated b3d models are pivots.

And note that any kind of entity can be a child of any other kind of entity. Thus, pivots can be children of meshes, cameras can be children of pivots, whatever. The relevant command is EntityParent.

As for the position returned, what skid said. EntityX defaults to the local coordinates for an entity; in other words, it's position relative to it's parent. If you want the position relative to the world, you need to specify that when calling EntityX.


Sir Gak(Posted 2006) [#11]
There's that word again, 'large'. Why are things so large in the future - is there a problem with the Earth's gravitational pull?

Yes, but since, in the future, they have 1.2TeraHz multi-processor CPUs with 40 TeraBytes RAM and 160 Peta Softdrives (quantum holographic, naturally), then we need to get back to the future.


octothorpe(Posted 2006) [#12]
in the future, they have 1.2TeraHz multi-processor CPUs


I think you meant 1.21 JiggaHz ;)