Examples of Matrix4f


Examples of javax.vecmath.Matrix4f

  public Object clone() throws CloneNotSupportedException{
    TransformDataXith3d res=(TransformDataXith3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3f();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();   
    return res;
  }
View Full Code Here

Examples of javax.vecmath.Matrix4f

        // avoids cumulative rounding errors
        // This should avoid "non-congruent transform above view transform"
        // exception
        _transform.setAutoNormalize(true);
        _tempTransform = new Transform3D();
        _zoom = new Matrix4f();
        _zoom.setIdentity();
        _rot = new Matrix4f();
        _rot.setIdentity();
        _trans = new Matrix4f();
        _trans.setIdentity();
        _drotX = new Matrix4f();
        _drotY = new Matrix4f();
        _vtrans = new Vector3f();
        _zoomFactor = 0.f;
        _scaleFactor = 1.f;
        _eyeDistance = 2.f;
        _transFactorX = 0.f;
View Full Code Here

Examples of javax.vecmath.Matrix4f

        float dx = (float) (newX - _pos2DX) / _wsize;
        float dy = (float) (newY - _pos2DY) / _wsize;
        _pos2DX = newX;
        _pos2DY = newY;
        AxisAngle4f aa = new AxisAngle4f(view, (dx - dy) * (float) Math.PI);
        Matrix4f mat = new Matrix4f();
        mat.setIdentity();
        mat.setRotation(aa);
        mat.mul(_rot);
        _rot = mat;
        applyTransform();
    }
View Full Code Here

Examples of javax.vecmath.Matrix4f

        _viewingPlatform.getViewPlatformTransform().setTransform(_transform);
    }
   
    public Object clone() throws CloneNotSupportedException{
        ViewTransform res=(ViewTransform)super.clone();
        res._zoom=new Matrix4f(_zoom);
        res._rot=new Matrix4f(_rot);
        res._drotX=new Matrix4f(_drotX);
        res._drotY=new Matrix4f(_drotY);
        res._trans=new Matrix4f(_trans);
        res._vtrans=new Vector3f(_vtrans);

        res._transform = new Transform3D();
        res._transform.setAutoNormalize(true);
        res._tempTransform = new Transform3D();
View Full Code Here

Examples of javax.vecmath.Matrix4f

  public Object clone() throws CloneNotSupportedException{
    TransformDataJava3d res=(TransformDataJava3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3d();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();
    return res;
  }
View Full Code Here

Examples of javax.vecmath.Matrix4f

        ConstraintSolver solver = new SequentialImpulseConstraintSolver();
        dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
        dynamicsWorld.setGravity(new Vector3f(0, -10 /* m/s2 */, 0));
        CollisionShape groundShape = new StaticPlaneShape(new Vector3f(0, 1, 0), 0.25f /* m */);
        CollisionShape ballShape = new SphereShape(3.0f);
        MotionState groundMotionState = new DefaultMotionState(new Transform(new Matrix4f(
                new Quat4f(0, 0, 0, 1),
                new Vector3f(0, 0, 0), 1.0f)));
        RigidBodyConstructionInfo groundBodyConstructionInfo = new RigidBodyConstructionInfo(0, groundMotionState, groundShape, new Vector3f(0, 0, 0));
        groundBodyConstructionInfo.restitution = 0.25f;
        RigidBody groundRigidBody = new RigidBody(groundBodyConstructionInfo);
View Full Code Here

Examples of javax.vecmath.Matrix4f

            controlBall.activate(true);
            controlBall.applyCentralForce(force);
        }
        if (createNewShape) {
            CollisionShape shape = new SphereShape(3.0f);
            DefaultMotionState motionState = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), new Vector3f(camera.x(), 35, camera.z()), 1)));
            Vector3f inertia = new Vector3f();
            shape.calculateLocalInertia(1.0f, inertia);
            RigidBodyConstructionInfo constructionInfo = new RigidBodyConstructionInfo(1.0f, motionState, shape, inertia);
            constructionInfo.restitution = 0.75f;
            RigidBody body = new RigidBody(constructionInfo);
View Full Code Here

Examples of javax.vecmath.Matrix4f

        PhysicsSphere(Vector4f colour, Vector3f position, DynamicsWorld physicsWorld, float mass, float radius, int slices, int stacks) {
            this.colour = colour;
            this.radius = radius;
            this.slices = slices;
            this.stacks = stacks;
            MotionState motion = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), position, 1.0f)));
            CollisionShape shape = new SphereShape(radius);
            this.physicsBody = new RigidBody(mass, motion, shape);
            this.physicsWorld = physicsWorld;
            this.physicsWorld.addRigidBody(physicsBody);
            this.renderSphere = new org.lwjgl.util.glu.Sphere();
View Full Code Here

Examples of javax.vecmath.Matrix4f

        CollisionShape groundShape = new StaticPlaneShape(new Vector3f(0, 1, 0), 0.25f);
        // Initialise 'ballShape' to a sphere with a radius of 3 metres.
        CollisionShape ballShape = new SphereShape(3);
        // Initialise 'groundMotionState' to a motion state that simply assigns the origin [0, 0, 0] as the origin of
        // the ground.
        MotionState groundMotionState = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), new Vector3f(0, 0, 0), 1.0f)));
        // Initialise 'groundBodyConstructionInfo' to a value that contains the mass, the motion state, the shape, and the inertia (= resistance to change).
        RigidBodyConstructionInfo groundBodyConstructionInfo = new RigidBodyConstructionInfo(0, groundMotionState, groundShape, new Vector3f(0, 0, 0));
        // Set the restitution, also known as the bounciness or spring, to 0.25. The restitution may range from 0.0
        // not bouncy) to 1.0 (extremely bouncy).
        groundBodyConstructionInfo.restitution = 0.25f;
View Full Code Here

Examples of javax.vecmath.Matrix4f

        // If a new shape should be created ...
        if (createNewShape) {
            // Create the collision shape (sphere with radius of 3 metres).
            CollisionShape shape = new SphereShape(3);
            // Create the motion state (x and z are the same as the camera's).
            DefaultMotionState motionState = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), new Vector3f(camera.x(), 35, camera.z()), 1.0f)));
            // Calculate the inertia (resistance to movement) using the ball's mass of 1 kilogram.
            Vector3f inertia = new Vector3f(0, 0, 0);
            shape.calculateLocalInertia(1.0f, inertia);
            RigidBodyConstructionInfo constructionInfo = new RigidBodyConstructionInfo(1, motionState, shape, inertia);
            constructionInfo.restitution = 0.75f;
            RigidBody rigidBody = new RigidBody(constructionInfo);
            balls.add(rigidBody);
            dynamicsWorld.addRigidBody(rigidBody);
            createNewShape = false;
        }
        // If the controllable ball's position and orientation should be reset ...
        if (resetControlBall) {
            // Set the position of the ball to (0, 50, 0).
            controlBall.setCenterOfMassTransform(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), new Vector3f(0, 50, 0), 1.0f)));
            // Reset the angular velocity (spinning movement) of the ball.
            controlBall.setAngularVelocity(new Vector3f(0, 0, 0));
            // Reset the linear velocity (x,y,z movement) of the ball.
            controlBall.setLinearVelocity(new Vector3f(0, 0, 0));
            resetControlBall = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.