Away3D Forum 0 Copyright (c) 2015 ExpressionEngine tag:away3d.com,2015:07:14 rigidbody go through the wall after applyCentralImpulse tag:away3d.com,2013:forum/viewthread/.4720 2013-07-11T04:25:57Z 0 Interesting i am implementing an air hockey game using AwayPhysics

when the puck collide with the stick, i add central impulse to the puck

sometimes the puck will go through static rigid walls i set in the scene

and this often occurs when the puck moves fast

i am a newbie to AwayPhysics and i think the reason for this is that

the position simulated has already out of walls

but i don’t know how to adjust that

could anyone help me, thanks!!

]]>
Both side and anta-alias issue with Flash Player 14 in Chrome tag:away3d.com,2014:forum/viewthread/.5605 2014-07-29T10:22:06Z 0 JulienR Hi everyone !

Today, i updated a Away3D project developped a few month ago.
I was surprised with the bad render of the 3ds objects in the scene. The both side no longer work and rendering is not quality.
Look at the attached file to understand the issue.

At first my Flash project run with Away3D 4.1.5. I have updated to 4.1.6 but the problem persists.

The problem come with the new version of Flash Player in Chrome v14.0 !

//Setup Scene
_scene = new Scene3D();
_camera = new Camera3D();
   
_view = new View3D();
_view.antiAlias 4;
_view.scene _scene;
_view.camera _camera;
_view.mousePicker PickingType.RAYCAST_BEST_HIT;
_view.backgroundColor 0x131313;

//Mesh setting example

mesh Mesh(e.target.getChildAt(0));
mesh.pickingCollider PickingColliderType.PB_BEST_HIT;
mesh.mouseEnabled true;
mesh.shaderPickingDetails true;
mesh.geometry.convertToSeparateBuffers();

var 
w:Weld = new Weld();
w.apply(mesh);
   
var 
explode:Explode = new Explode();
explode.apply(mesh.geometry);

var 
material:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(pAmfPiece.textureDiffuseCustomBitmap));
    
//
material.specularMap Cast.bitmapTexture(new SpecularMap() as Bitmap);
material.normalMap Cast.bitmapTexture(new NormalMap() as Bitmap);

material.lightPicker _lightPicker;
material.bothSides true;
material.specular 0.5;
material.gloss 0.6;
material.ambient 0.7;

mesh.material material

Thanks

]]>
FLASH CS5.5how to use awayphysics.swc tag:away3d.com,2011:forum/viewthread/.1354 2011-11-16T03:07:05Z 0 datouaizi I set awayphysics.swc as libirary swc file ,when i debug it swf ,error said AWPRigidBody isn`t defined ,AWPPhysicsWorld isn`t denfined ...!when I locate awayphysice original file into root path ,error said module.AwayPhysica is unimprove initClid is un`t defined…!

what should i do?

]]>
Error #1506: The specified range is invalid. tag:away3d.com,2014:forum/viewthread/.5709 2014-11-04T01:45:28Z 0 Shine Chen When do quickly create AWPRigidBody and addRigidBody to world, had below issue.

Error #1506: The specified range is invalid. 

Anybody know it?

]]>
Both side and anta-alias issue with Flash Player 14 in Chrome tag:away3d.com,2014:forum/viewthread/.5604 2014-07-29T10:19:32Z 0 JulienR Hi everyone !

Today, i updated a Away3D project developped a few month ago.
I was surprised with the bad render of the 3ds objects in the scene. The both side no longer work and rendering is not quality.
Look at the attached file to understand the issue.

At first my Flash project run with Away3D 4.1.5. I have updated to 4.1.6 but the problem persists.

//Setup Scene
_scene = new Scene3D();
_camera = new Camera3D();
   
_view = new View3D();
_view.antiAlias 4;
_view.scene _scene;
_view.camera _camera;
_view.mousePicker PickingType.RAYCAST_BEST_HIT;
_view.backgroundColor 0x131313;

//Mesh setting example

mesh Mesh(e.target.getChildAt(0));
mesh.pickingCollider PickingColliderType.PB_BEST_HIT;
mesh.mouseEnabled true;
mesh.shaderPickingDetails true;
mesh.geometry.convertToSeparateBuffers();

var 
w:Weld = new Weld();
w.apply(mesh);
   
var 
explode:Explode = new Explode();
explode.apply(mesh.geometry);

var 
material:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(pAmfPiece.textureDiffuseCustomBitmap));
    
//
material.specularMap Cast.bitmapTexture(new SpecularMap() as Bitmap);
material.normalMap Cast.bitmapTexture(new NormalMap() as Bitmap);

material.lightPicker _lightPicker;
material.bothSides true;
material.specular 0.5;
material.gloss 0.6;
material.ambient 0.7;

mesh.material material

Thanks

]]>
Object go through other Object. tag:away3d.com,2014:forum/viewthread/.5528 2014-06-06T12:02:49Z 0 Harilal K M Am making a game to catch coocckies which is falling from the sky. Am able add awayPhysics .Now the cookies falling from the sky and created a box which catch the coockies. But the problem is the coockies inside the box go throuh the box walls when i move fast the Box.  I adjusted the mass value . But still is not working .. this is my code :

http://pastebin.com/PS9RDSrL

]]>
AWPBvhTriangleMeshShape surface is not smooth tag:away3d.com,2013:forum/viewthread/.5128 2013-11-22T20:46:39Z 2013-11-22T20:52:47Z Whypay Hi there,

I am creating a ball game, where a ball follows a way. The way is a AWPBvhTriangleMeshShape. But unfortunately, the ball jumps up and changes its direction when it is rolling over edges - even if the surface is flat.

I have created a project to reproduce this behaviour. There is a PlaneGeometry and a SphereGeometry. When moving the ball, it starts to jump at the edges of the plane surface.


I have uploaded a movie of the project, where you can see the ball jumps up: http://de.tinypic.com/r/2ibymh5/5

Is this a bug or is there a solution to get rid of this problem? I really need the AWPBvhTriangleMeshShape, as the way is not a straight one.


Here is the code, woul’d be very happy is someone coul’d help me out.

package
{
 import flash
.display.Sprite;
 
import flash.events.Event;
 
import flash.events.KeyboardEvent;
 
import flash.geom.Vector3D;
 
import flash.text.TextField;
 
import flash.text.TextFormat;
 
import flash.ui.Keyboard;
 
 
import away3d.containers.View3D;
 
import away3d.debug.AwayStats;
 
import away3d.entities.Mesh;
 
import away3d.lights.PointLight;
 
import away3d.materials.ColorMaterial;
 
import away3d.materials.lightpickers.StaticLightPicker;
 
import away3d.primitives.PlaneGeometry;
 
import away3d.primitives.SphereGeometry;
 
 
import awayphysics.collision.shapes.AWPBvhTriangleMeshShape;
 
import awayphysics.collision.shapes.AWPSphereShape;
 
import awayphysics.debug.AWPDebugDraw;
 
import awayphysics.dynamics.AWPDynamicsWorld;
 
import awayphysics.dynamics.AWPRigidBody;
 
 
[SWF(backgroundColor="#000000"frameRate="60"width="600"height="400")]
 
public class BvhTriangleMesh extends Sprite
 {
  
private var _view View3D;
  private var 
_light PointLight;
  private var 
_lightPicker:StaticLightPicker;
  private var 
_physicsWorld AWPDynamicsWorld;
  private var 
_debugDraw:AWPDebugDraw;
  private var 
_timeStep Number 1.0 60;
  private var 
_bodySphere:AWPRigidBody;
  private var 
_text:TextField;
  private var 
_textFormat:TextFormat;
  
  public function 
BvhTriangleMesh()
  
{
   
if (stageinit();
   else 
addEventListener(Event.ADDED_TO_STAGEinit);
  
}
  
  
  
private function init():void{
   removeEventListener
(Event.ADDED_TO_STAGEinit);
   
   
   
_view = new View3D();
   
this.addChild(_view);
   
this.addChild(new AwayStats(_view));
   
   
_light = new PointLight();
   
_light.5000;
   
_view.scene.addChild(_light);
   
   
_lightPicker = new StaticLightPicker([_light]);

   
_view.camera.lens.far 20000;
   
_view.camera.2000;
   
_view.camera.= -2000;
   
_view.camera.rotationX 40;
   
   
   
// init the physics world
   
_physicsWorld AWPDynamicsWorld.getInstance();
   
_physicsWorld.initWithDbvtBroadphase();
   
   
_debugDraw = new AWPDebugDraw(_view_physicsWorld); 
   
_debugDraw.debugMode AWPDebugDraw.DBG_NoDebug;
   
_debugDraw.debugMode AWPDebugDraw.DBG_DrawCollisionShapes;
   
   
addObjects();
   
   
stage.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
stage.addEventListener(KeyboardEvent.KEY_DOWNonDownHandler);
  
}
  
  
  
private function addObjects():void{
   
   
var material ColorMaterial = new ColorMaterial(0xfa6c16);
   
material.lightPicker _lightPicker;
   
   var 
mesh Mesh;
   
   
//Create plane:
   
var iSeg:uint 3;
   
mesh = new Mesh(new PlaneGeometry(2000020000iSegiSeg), material);
   
_view.scene.addChild(mesh);
   var 
triangleShape AWPBvhTriangleMeshShape = new AWPBvhTriangleMeshShape(mesh.geometry);
   var 
planeBody:AWPRigidBody = new AWPRigidBody(triangleShapemesh0);
   
planeBody.position = new Vector3D(000);
   
planeBody.restitution 0.5;
   
   
_physicsWorld.addRigidBody(planeBody);
   
   
   
   
//Creat shpere:
   
var sphereShape:AWPSphereShape = new AWPSphereShape(100);
   
mesh = new Mesh(new SphereGeometry(100), material);
   
_view.scene.addChild(mesh);
   
_bodySphere = new AWPRigidBody(sphereShapemesh1);
   
_bodySphere.friction .9;
   
_bodySphere.restitution 0.9;
   
_bodySphere.position = new Vector3D(-10006000);
   
_physicsWorld.addRigidBody(_bodySphere);
   
   
_textFormat = new TextFormat('Arial'200xfffffftrue);
   
_text = new TextField();
   
_text.this.width/2;
   
_text.20;
   
_text.width 400;
   
this.addChild(_text);
   
   
  
}
  
  
  
private function onEnterFrame(Event):void{
   _physicsWorld
.step(_timeStep);
   
_debugDraw.debugDrawWorld();
   
_view.render();
   
   
_view.camera.position _bodySphere.position.add(new Vector3D(02000, -2500));
   
_view.camera.lookAt(_bodySphere.position);
   
   
   
_text.text "ball.y: " _bodySphere.position.y.toFixed(3);
   
_text.setTextFormat(_textFormat);
   
  
}
  
  
private function onDownHandler(event KeyboardEvent):void{
   
var fForce:Number 1;
   
   if(
event.keyCode==Keyboard.UP_bodySphere.applyCentralImpulse(new Vector3D(0,0,fForce));
   if(
event.keyCode==Keyboard.DOWN_bodySphere.applyCentralImpulse(new Vector3D(0,0,-fForce));
   if(
event.keyCode==Keyboard.LEFT_bodySphere.applyCentralImpulse(new Vector3D(-fForce,0,0));
   if(
event.keyCode==Keyboard.RIGHT_bodySphere.applyCentralImpulse(new Vector3D(fForce,0,0));
  
}
 }

 

]]>
obj - AWPBvhTriangleMeshShape terrain problem tag:away3d.com,2013:forum/viewthread/.3930 2013-02-01T19:55:49Z 2013-02-01T20:01:29Z Luca Hi guys,

Someone can see and eventually correct this…
Here the source:
http://www.estiva2.altervista.org/Away3D/CarSampleMod1.7z

( the source contains two version of library incuded in the 7z file )

This is important for me… With version 4.1 i can load the right material or/and texture but the physics can’t work…

Thanks in advance smile

]]>
AWPBvhTriangleMeshShape error tag:away3d.com,2013:forum/viewthread/.4730 2013-07-14T02:55:06Z 0 Léo Santana Hi guys,

Please help me with this problem:

var mat:ColorMaterial = new ColorMaterial(0x4B871F);
mat.lightPicker = stateLight;
var mesh:Mesh = Mesh(ObjectContainer3D(e.target).getChildAt(0));
//mesh.scale(100);
mesh.material = mat;
//view.scene.addChild(mesh);
var shape:AWPBvhTriangleMeshShape = new AWPBvhTriangleMeshShape(mesh.geometry);
var body:AWPRigidBody = new AWPRigidBody(shape, mesh, 0);
body.scale = new Vector3D(40, 40, 40);
world.addRigidBody(body);

I’m using away4.1.1 and awayphysics-core-fp11-master

Thanks!

]]>
6DofConstraint motor problem tag:away3d.com,2013:forum/viewthread/.4591 2013-06-04T00:11:01Z 2013-06-04T00:16:38Z rfenner We are working on a project and were getting a random 1125 error in bullet. We decided to update to 4.1.1 beta and the dev branch of away physics. The update seem to fix the crash we were getting but we are now having a problem with one of our constraints with a translational motor not working.
We have 2 of them set up one that slides back and forth along the Z axis it still works ok. The other slides along the Y axis up and down however it longer wants to move. I’ve tried increasing the velocity and motor force to no effect. Any one how any ideas? Heres the code that sets up the rigidbody and constraint.
This was all working on the 4.0.11 alpha build with the master branch of awayphysics.

var rigidbodyPiece Object = new Object();
            
            var 
l_wall_pos Vector3D   = new Vector3D(-m_asset_wall_offset_x00);
            var 
r_wall_pos Vector3D   = new Vector3D(m_asset_wall_offset_x00);
            
            
m_l_wall_shape = new AWPBoxShape(m_asset_wall_widthm_asset_size.ym_asset_size.z);
            
m_r_wall_shape = new AWPBoxShape(m_asset_wall_widthm_asset_size.ym_asset_size.z);
            
            
shape = new AWPCompoundShape();
            
shape.addChildShape(m_l_wall_shapel_wall_pos, new Vector3D());
            
shape.addChildShape(m_r_wall_shaper_wall_pos, new Vector3D());
            

            
            
rigidbody = new AWPRigidBody(shapemesh10);
            
rigidbody.gravity = new Vector3D();
            
            
super.initRigidbody(rigidbody);
            
            
rigidbody.WALL_Y_START;
            
rigidbody.+= 375;
            
//after tracing through for some reason the low y is
            //doubled so at -300 it's actualy -600 with out doubling
            //are low it was throwing off the high. The 5 is pull
            //the low/high in a little as they dont end up at exact values
            
m_wall_low_y WALL_Y_START 2;
            
m_wall_high_y m_wall_low_y m_asset_slide_distance 5;
            
m_wall_low_y += 5;
            
            
m_physicsWorld.addRigidBodyWithGroup(rigidbodySceneObject.GroundFloorGroupSceneObject.FloorCollisionMask);

            
m_constraint = new AWPGeneric6DofConstraint(rigidbodyrigidbody.position, new Vector3D());
            var 
low Vector3D  = new Vector3D(rigidbody.xrigidbody.yrigidbody.z);
            var 
high Vector3D = new Vector3D(rigidbody.xrigidbody.m_asset_slide_distancerigidbody.z);
            
m_constraint.setLinearLimit(lowhigh);
            
m_constraint.setAngularLimit(new Vector3D(000), new Vector3D(000));
            
m_constraint.getTranslationalLimitMotor().enableMotorY true;
            
m_constraint.getTranslationalLimitMotor().targetVelocity = new Vector3D(0300);
            
m_constraint.getTranslationalLimitMotor().maxMotorForce = new Vector3D(0100);
            
            
//rigidbody.position = new Vector3D(rigidbody.position.x, rigidbody.position.y + m_asset_slide_distance, rigidbody.position.z);
            
            
m_physicsWorld.addConstraint(m_constrainttrue); 
]]>