I think I might be missing some context for your question.

Object3D is the parent class for ObjectContainer3D.

ObjectContainer3D has the addChild method, and it assumes that you're
adding other ObjectContainer3D's as children. You cannot necessarily
add an Object3D as a child, UNLESS it actually is at least an
ObjectContainer3D concretely.

If shape is allocated concretely as at least an ObjectContainer3D (one
level below Object3D), you can add it by...
this.addChild(shape as ObjectContainer3D);

But I would question why you're worried about storing shape as an
Object3D in the first place.

-Dave

On Mar 24, 12:18 pm, polyGeek <[email protected]> wrote:
> I've done this before in Away3D 3.6 where I have a function that takes
> on a generic away3d.core.base.Object3D as a parameter that can then
> added to an ObjectContainer3D.
>
> However the same does not seem to be working in 4.0. I'm getting the
> following error:
>
> 1118: Implicit coercion of a value with static type
> away3d.core.base:Object3D to a possibly unrelated type
> away3d.containers:ObjectContainer3D.
>
> Here is the code:
>
> // this = ObjectContainer3D, shape = Object3D
> this.addChild( shape );

Reply via email to