Away3D Forum 0 Copyright (c) 2013 ExpressionEngine tag:away3d.com,2013:05:15 DebugDraw is not showing up. tag:away3d.com,2013:forum/viewthread/.4473 2013-05-10T06:54:52Z 0 vikramarka Hi there!
I am very much new to awqy3d and awayphysics. I am facing a problem with my game. Hope someone can help me.

I am trying to build a spoon egg game and I am creating both egg and spoon shapes using AWPConvexHullShape. The problem is the egg is appearing a little bit above from the spoon and I cant figure it why! The code I am using is

scene.addChild(spoonModel);
     var 
spoonShape:AWPConvexHullShape = new AWPConvexHullShape(spoonModel.geometry);
     
spoonBody = new AWPRigidBody(spoonShape,spoonModel,0);
     
spoonBody.friction 4;
     
spoonBody.position = new Vector3D(0,0,-150);
     
spoonBody.rotationY = -90;
     
physicsWorld.addRigidBody(spoonBody);
     
scene.addChild(eggModel);
     var 
eggShape:AWPConvexHullShape = new AWPConvexHullShape(eggModel.geometry);
     
eggBody = new AWPRigidBody(eggShape,eggModel,1);
     
eggBody.position = new Vector3D(0,100,10);
     
eggBody.mass 10;
     
eggBody.rotationY = -90;
     
eggBody.friction 4;
     
physicsWorld.addRigidBody(eggBody); 


I don’t have any clue about what was happening because I cant see the debugdraw also. I have searched for any tutorial about debugdraw and I found none.

It would be very grateful for me If I got through this.

]]>
Mutex error when publishing to iOS? tag:away3d.com,2013:forum/viewthread/.4483 2013-05-14T03:33:57Z 0 Logrey I’m trying to do some iOS tests, and being completey unsuccessful. I’m working in Flash Builder 4.7, with Away 3D 4.1, the latest AwayPhysics (from GitHub), and AIR SDK 3.7. As soon as I declare my physics world (var physicsWorld:AWPDynamicsWorld), and publish to iOS, I get this error:

Error #1520: Mutex cannot be initialized.

If I comment out that one declaration, it’s fine. And If I publish as a non-mobile AIR app, it works fine. Any thoughts? Has anyone successfully used AwayPhysics on iOS (in all my searches for AwayPhysics errors, I’ve only seen one post with a Mutex error and the solve was using Air 3.4 - not something I’d like to do). Any thoughts?

]]>
Help with ConvexHullShape tag:away3d.com,2013:forum/viewthread/.4474 2013-05-10T06:56:01Z 0 vikramarka Hi there!
I am very much new to awqy3d and awayphysics. I am facing a problem with my game. Hope someone can help me.

I am trying to build a spoon egg game and I am creating both egg and spoon shapes using AWPConvexHullShape. The problem is the egg is appearing a little bit above from the spoon and I cant figure it why! The code I am using is

scene.addChild(spoonModel);
     var 
spoonShape:AWPConvexHullShape = new AWPConvexHullShape(spoonModel.geometry);
     
spoonBody = new AWPRigidBody(spoonShape,spoonModel,0);
     
spoonBody.friction 4;
     
spoonBody.position = new Vector3D(0,0,-150);
     
spoonBody.rotationY = -90;
     
physicsWorld.addRigidBody(spoonBody);
     
scene.addChild(eggModel);
     var 
eggShape:AWPConvexHullShape = new AWPConvexHullShape(eggModel.geometry);
     
eggBody = new AWPRigidBody(eggShape,eggModel,1);
     
eggBody.position = new Vector3D(0,100,10);
     
eggBody.mass 10;
     
eggBody.rotationY = -90;
     
eggBody.friction 4;
     
physicsWorld.addRigidBody(eggBody); 


I don’t have any clue about what was happening because I cant see the debugdraw also. I have searched for any tutorial about debugdraw and I found none.

It would be very grateful for me If I got through this.

]]>
iOS performance issue - Can I use physics? tag:away3d.com,2013:forum/viewthread/.4458 2013-05-07T12:27:16Z 0 Francks In my project I had intended to use physics via AwayPhysics. Running on PC, I got 60 fps easily, but running on iOS (6.1.3, on iPod Touch 4th) the app runs at 1 fps! When disabling physics, then I got 30 fps on it. On my Android tablet the problem is like: 30 fps only (reminding that that tablet has a better processor + gpu).

Is it possible to use AwayPhysics on mobile devices? Or should I try other engine? Should I adjust the apps for their operating systems?

Thanks in advance smile

]]>
add sideways movement to character demo? tag:away3d.com,2013:forum/viewthread/.4464 2013-05-08T15:20:01Z 0 hfeist I’m trying to make the character in the character demo also walk sideways. At the moment he can move forward and back or rotate left or right via arrow keys but not laterally.
Might there be a clue here?

if (keyForward)
    
{
     
if (walkDirection.length == 0)
     
{
      _animationController
.play("walk"_stateTransition);
      
_animationController.playbackSpeed 1;
     
}
     walkDirection 
character.ghostObject.front;
     
walkDirection.scaleBy(walkSpeed);
     
character.setWalkDirection(walkDirection);
    

]]>
Problems using a MouseJoint tag:away3d.com,2013:forum/viewthread/.4396 2013-04-21T21:13:39Z 2013-04-21T21:15:20Z markuse I’m experimenting with a simulation of a “MouseJoint”, like the one I know from Box2D (see e.g. http://shiftarray.com/away3d-with-box2d-physics/). 

For a project I need to work the MouseJoint in real 3D, not only in a look-alike-3D as in the former example. My idea was to create a “MouseObject” at the position where the user clicks at the draggable object. Then create a AWPPoint2PointConstraint with the MouseObject and the draggable box as the two RigidBodies. Then create a Drag3D-Object for the MouseObject and update that in the render-loop. Unfortunately something must be really wrong in my code, because the result looks quite weird.

So please, is there anybody out there to show me how it works with AwayPhysics?

Here’s what I got so far:

//create a draggable box
var size:int 400;
var 
mass:int 10;
var 
mat:ColorMaterial = new ColorMaterial(0xfc6a11);
mat.lightPicker _lightPicker;
_boxMesh = new Mesh(new CubeGeometry(size,size,size),mat);
var 
shape:AWPBoxShape = new AWPBoxShape(size,size,size);
_boxBody = new AWPRigidBody(shape_boxMeshmass);
_boxBody.position = new Vector3D(0,1000,0);
_view.scene.addChild(_boxMesh);
_world.addRigidBody(_boxBody);
_boxMesh.mouseEnabled true;
_boxMesh.addEventListener(MouseEvent3D.MOUSE_DOWNstartDragging);

//here are the two mouse-handlers:

private function startDragging(e:MouseEvent3D):void
{
 _boxMesh
.removeEventListener(MouseEvent3D.MOUSE_DOWNstartDragging);
 
_view.stage.addEventListener(MouseEvent.MOUSE_UPstopDragging);
   
 var 
mouseDownPos:Vector3D = new Vector3D(e.object.xe.object.ye.object.z);
   
 
// add mouse object
 
_mouseBody.position mouseDownPos;
 
_view.scene.addChild(_mouseMesh);
 
_world.addRigidBody(_mouseBody);
   
 
// create the mouse joint
 
_mouseJoint = new AWPPoint2PointConstraint(_mouseBodymouseDownPos_boxBody, new Vector3D());
 
_world.addConstraint(_mouseJointtrue);
   
 
// enable dragging
 
_drag3D = new Drag3D(_viewObjectContainer3D(_mouseMesh), "xy");  
 
_drag3D.offsetCenter false;
 
_dragging true;   
}
  
private function stopDragging(e:MouseEvent):void 
{
 _dragging 
false;
   
 
_boxMesh.addEventListener(MouseEvent3D.MOUSE_DOWNstartDragging);
 
_view.stage.removeEventListener(MouseEvent.MOUSE_UPstopDragging);
   
 
// remove the mouse joint
 
_world.removeConstraint(_mouseJoint);
 
_mouseJoint null;
   
 
// remove the mouse object
 
_view.scene.removeChild(_mouseMesh);
 
_world.removeRigidBody(_mouseBody);
}

// and my render loop:
private function loop(e:Event) : void 
{
 _world
.step(timeStep);
   
 
_debugDraw.debugDrawWorld();
   
 if(
_dragging{
  _drag3D
.updateDrag();
  
_mouseBody.position _mouseMesh.position;
 
}
   
 _view
.render();

Whole AS-File is attached below.

Any help is highly appreciated.

Thanks,
Markus

]]>
First Person Collision Detection with awayphysics tag:away3d.com,2013:forum/viewthread/.3965 2013-02-07T12:36:55Z 0 Manuel L. Hey,
i`m trying to create collision detection for firstperson-view with awayphysics.
i tried with collision shapes and with rigidbodies. both worked, but not in a useful way for first person collision detection.

Some questions ...

is it possible?
is it recommended?
use collisionshapes or rigidbodies?
alternatives?

would be awesome if somebody can lead me into the right direction ^^

thx!

]]>
way to prevent fov & terrain artifacts tag:away3d.com,2013:forum/viewthread/.4383 2013-04-19T07:09:49Z 2013-04-19T07:11:37Z Bartek5186 Hello… I have a little bit knowledge problem with artifacts . I have set large terrain with large FOV (terrain 150.000, FOV 70.000). the problem is that terrain elements in FOV border blinking and shaking. This is normal effect in when terrain have heights and range more than FOV… but my question is that, can we prevent this ?

]]>
How to change rigidBody shape tag:away3d.com,2013:forum/viewthread/.4381 2013-04-18T18:46:12Z 0 ranoya Anyone knows if is possible to change the rigidBody´s shape?

The only way I´ve discovered until now is changing the rigidBody´s scale, but in some situations, I´de like to change the shape,  but

rigidBody.shape = anotherShape

is not pssible (ther´s no such setter function)

Thanks.

]]>
Rotating 360 degrees tag:away3d.com,2013:forum/viewthread/.4367 2013-04-16T11:50:53Z 0 Francks I can rotate a object in 360 degrees, using angularVelocity property. However I can’t get a value between 0 and 360 degrees, it gives me only between -90 and 90. I would need a whole value from rotation to handle the camera position in the way of my project. How could I get this?

Tks in advance

]]>