Hello,
I am still a beginner with Away3D and I am still playing with sample programs to grasp the basic concepts before creating my game.
I am using citrus engine compiled with awayphysics-core-fp11-master and away3d-core-fp11-master.
I am modifying the car sample to load a 3D character model which was used in AwayBuilder tutorial instead.
The character appears floating above the ground with very noticeable distance.
I turned debug view on and it appears that the cylinder ghost object is not aligned correctly with the character, how can I fix this?
I attached a screen shot and here is the code.
private function _onCarResourceComplete(event:LoaderEvent):void {
var container:ObjectContainer3D = ObjectContainer3D(event.target);
(view as Away3DView).viewRoot.addChild(container);
container.visible = true;
var mesh:Mesh;
var carMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new CarSkin().bitmapData));
carMaterial.lightPicker = _lightPicker;
for (var i:uint = 0; i < container.numChildren; ++i) {
mesh = Mesh(container.getChildAt(i));
mesh.geometry.scale(10);
}
Bounds.getObjectContainerBounds(container);
var shape : AWPCapsuleShape = new AWPCapsuleShape(Bounds.width, Bounds.height);
var ghostObject : AWPGhostObject = new AWPGhostObject(shape, container);
ghostObject.collisionFlags |= AWPCollisionFlags.CF_CHARACTER_OBJECT;
ghostObject.addEventListener(AWPEvent.COLLISION_ADDED, characterCollisionAdded);
carBody = new AWPKinematicCharacterController(ghostObject, 200);
_awayPhysics.world.addCharacter(carBody);
carBody.warp(new Vector3D(0, 10, -500));
}
Any help will be greatly appreciated, thanks for advance.