Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object does not go inside open ended Cylinder Mesh, instead seems to collide #304

Open
AngVen opened this issue Jan 21, 2018 · 0 comments
Open

Comments

@AngVen
Copy link

AngVen commented Jan 21, 2018

Hello,

Consider as tube and a sphere

        var mOil1 = new THREE.MeshLambertMaterial({
            color: 0xAD8D30,
            refractionRatio: 0.5,
            opacity: 0.7,
            transparent: true,
            side: THREE.DoubleSide
        });

        var mPhyGlass = Physijs.createMaterial(
            mOil1,
            .4, // low friction
            .6 // high restitution
        );
        var glassTube = new Physijs.CylinderMesh(
            new THREE.CylinderGeometry(1, 1, 10, 24,1,true),
            mPhyGlass,
            0.1
        );
        glassTube.castShadow = true;
        glassTube.receiveShadow = true;
        glassTube.position.set(
            0,
            6,
            0
        );

var mPhyOil = Physijs.createMaterial(
mOil1,
.4, // low friction
.6 // high restitution
);
var sphere_geometry = new THREE.SphereGeometry(0.5, 32, 32);
var Ballshape = new Physijs.SphereMesh(
sphere_geometry,
mPhyOil,
0.5,
{ restitution: Math.random() * 1.5 }
);
Ballshape.castShadow = true;
Ballshape.receiveShadow = true;
Ballshape.position.set(
0,
12,
0
);

The scene has a ground...
// Ground
ground = new Physijs.BoxMesh(
new THREE.BoxGeometry(100, 1, 100),
ground_material,
0 // mass
);
ground.receiveShadow = true;
scene.add(ground);

The glassTube cylinder geometry is open ended. Now when you simulate the Ballshape falls and sits on the top of the tube.

The scene has a ground...
// Ground
ground = new Physijs.BoxMesh(
new THREE.BoxGeometry(100, 1, 100),
ground_material,
0 // mass
);
ground.receiveShadow = true;
scene.add(ground);

Effectively it is supposed to go thru to tube.

I am trying to simulate a glass tube filled with some small objects. ( off course this tube here is open ended on both sides, but will create something like a text tube) When the tube is tilted the objects will roll out. (since the tube is resting on the ground vertically assuming that it would be as if closed at the bottom)

is there something that i am missing or is this the behavior of collision and that i cannot achieve the desired effect.

@AngVen AngVen changed the title Object does go inside open ended Cylinder Mesh, instead seems to collide Object does not go inside open ended Cylinder Mesh, instead seems to collide Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant