javax.vecmath.Vector3f Java Examples

The following examples show how to use javax.vecmath.Vector3f. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Skylight_BulletPhysics_Breakable.java    From PixelFlow with MIT License 6 votes vote down vote up
public void dropBox(){
    float dimr = random(50,80);
    float mass = dimr*dimr*dimr;
    Vector3f pos = new Vector3f(random(-150,150), random(-150,150), 10 + dimr*0.5f + 3 * 125 + 300);
    Vector3f vel = new Vector3f(0, 0, -1000);

    BObject body = new MyBBox(this, mass, dimr, dimr, dimr);
    body.setPosition(pos);
    body.setVelocity(vel);
//    body.rigidBody.setRestitution(0.1f);
//    body.rigidBody.setFriction(1);
//    body.rigidBody.setHitFraction(1);
//    body.rigidBody.setDamping(0.1f, 0.1f);
    body.rigidBody.setUserPointer(body);
    
    body.displayShape = createShape(BOX, dimr, dimr, dimr);
    body.displayShape.setStroke(false);
    body.displayShape.setFill(true);
    body.displayShape.setFill(color(255,200,0));
    body.displayShape.setStrokeWeight(1);
    body.displayShape.setStroke(color(0));
    body.displayShape.setName("[box] [wire]");
    
    physics.addBody(body);
    group_bulletbodies.addChild(body.displayShape);
  }
 
Example #2
Source File: FaceBakery.java    From The-5zig-Mod with MIT License 6 votes vote down vote up
private void fillNormal(int[] faceData) {
	Vector3f v1 = new Vector3f(faceData[3 * 7 + 0], faceData[3 * 7 + 1], faceData[3 * 7 + 2]);
	Vector3f t = new Vector3f(faceData[1 * 7 + 0], faceData[1 * 7 + 1], faceData[1 * 7 + 2]);
	Vector3f v2 = new Vector3f(faceData[2 * 7 + 0], faceData[2 * 7 + 1], faceData[2 * 7 + 2]);
	v1.sub(t);
	t.set(faceData[0 * 7 + 0], faceData[0 * 7 + 1], faceData[0 * 7 + 2]);
	v2.sub(t, v1);
	v1.cross(v2, v1);
	v1.normalize();

	int x = ((byte) (v1.x * 127)) & 0xFF;
	int y = ((byte) (v1.y * 127)) & 0xFF;
	int z = ((byte) (v1.z * 127)) & 0xFF;
	for (int i = 0; i < 4; i++) {
		faceData[i * 7 + 6] = x | (y << 0x08) | (z << 0x10);
	}
}
 
Example #3
Source File: DrawARActivity.java    From justaline-android with Apache License 2.0 6 votes vote down vote up
/**
 * addPoint3f adds a point to the current stroke
 *
 * @param newPoint a 3D point in world space
 */
private void addPoint3f(Vector3f... newPoint) {
    Vector3f point;
    int index = mStrokes.size() - 1;

    if (index < 0)
        return;

    for (int i = 0; i < newPoint.length; i++) {
        if (mAnchor != null && mAnchor.getTrackingState() == TrackingState.TRACKING) {
            point = LineUtils.TransformPointToPose(newPoint[i], mAnchor.getPose());
            mStrokes.get(index).add(point);
        } else {
            mStrokes.get(index).add(newPoint[i]);
        }
    }

    // update firebase database
    mPairSessionManager.updateStroke(mStrokes.get(index));
    isDrawing = true;
}
 
Example #4
Source File: PMDRigidBody.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public PMDRigidBody(DataInputStreamLittleEndian is) throws IOException {
    rigidBodyName = is.readString(20);
    relBoneIndex = is.readUnsignedShort();
    rigidBodyGroupIndex = is.readUnsignedByte();
    rigidBodyGroupTarget = is.readUnsignedShort();
    shapeType = is.readUnsignedByte();
    shapeW = is.readFloat();
    shapeH = is.readFloat();
    shapeD = is.readFloat();
    pos = new Vector3f(is.readFloat(),is.readFloat(),-is.readFloat());
    rot = new Vector3f(-is.readFloat(),-is.readFloat(),is.readFloat());
    weight = is.readFloat();
    posDim = is.readFloat();
    rotDim = is.readFloat();
    recoil = is.readFloat();
    friction = is.readFloat();
    rigidBodyType = is.readUnsignedByte();
}
 
Example #5
Source File: LineShaderRenderer.java    From justaline-android with Apache License 2.0 6 votes vote down vote up
/**
 * setMemory is a helper method used to add the stroke data to the float[] buffers
 */
private void setMemory(int index, Vector3f pos, Vector3f prev, Vector3f next, float width, float side, float length, float endCapPosition) {
    mPositions[index * 3] = pos.x;
    mPositions[index * 3 + 1] = pos.y;
    mPositions[index * 3 + 2] = pos.z;

    mNext[index * 3] = next.x;
    mNext[index * 3 + 1] = next.y;
    mNext[index * 3 + 2] = next.z;

    mPrevious[index * 3] = prev.x;
    mPrevious[index * 3 + 1] = prev.y;
    mPrevious[index * 3 + 2] = prev.z;

    mSide[index] = side;
    mWidth[index] = width;
    mLengths[index] = length;
    mEndCaps[index] = endCapPosition;
}
 
Example #6
Source File: DebugMeshShaderRenderer.java    From justaline-android with Apache License 2.0 6 votes vote down vote up
/**
 * setMemory is a helper method used to add the stroke data to the float[] buffers
 */
private void setMemory(int index, Vector3f pos, Vector3f prev, Vector3f next, float counter, float width, float side) {
    mPositions[index * 3] = pos.x;
    mPositions[index * 3 + 1] = pos.y;
    mPositions[index * 3 + 2] = pos.z;

    mNext[index * 3] = next.x;
    mNext[index * 3 + 1] = next.y;
    mNext[index * 3 + 2] = next.z;

    mPrevious[index * 3] = prev.x;
    mPrevious[index * 3 + 1] = prev.y;
    mPrevious[index * 3 + 2] = prev.z;

    mCounters[index] = counter;
    mSide[index] = side;
    mWidth[index] = width;

}
 
Example #7
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java    From PixelFlow with MIT License 6 votes vote down vote up
public void dropBox(){
    float dimr = random(50,80);
    float mass = dimr*dimr*dimr;
    Vector3f pos = new Vector3f(random(-150,150), random(-150,150), 10 + dimr*0.5f + 3 * 125 + 300);
    Vector3f vel = new Vector3f(0, 0, -1000);

    BObject body = new MyBBox(this, mass, dimr, dimr, dimr);
    body.setPosition(pos);
    body.setVelocity(vel);
//    body.rigidBody.setRestitution(0.1f);
//    body.rigidBody.setFriction(1);
//    body.rigidBody.setHitFraction(1);
//    body.rigidBody.setDamping(0.1f, 0.1f);
    body.rigidBody.setUserPointer(body);
    
    body.displayShape = createShape(BOX, dimr, dimr, dimr);
    body.displayShape.setStroke(false);
    body.displayShape.setFill(true);
    body.displayShape.setFill(color(255,200,0));
    body.displayShape.setStrokeWeight(1);
    body.displayShape.setStroke(color(0));
    body.displayShape.setName("[box] [wire]");
    
    physics.addBody(body);
    group_bulletbodies.addChild(body.displayShape);
  }
 
Example #8
Source File: DebugShapeFactory.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 *  Retrieves the vertices from the Triangle buffer.
 */
public FloatBuffer getVertices() {
    // There are 3 floats needed for each vertex (x,y,z)
    final int numberOfFloats = vertices.size() * 3;
    FloatBuffer verticesBuffer = BufferUtils.createFloatBuffer(numberOfFloats); 

    // Force the limit, set the cap - most number of floats we will use the buffer for
    verticesBuffer.limit(numberOfFloats);

    // Copy the values from the list to the direct float buffer
    for (Vector3f v : vertices) {
        verticesBuffer.put(v.x).put(v.y).put(v.z);
    }

    vertices.clear();
    return verticesBuffer;
}
 
Example #9
Source File: LineShaderRenderer.java    From ar-drawing-java with Apache License 2.0 6 votes vote down vote up
/**
 *
 * setMemory is a helper method used to add the stroke data to the float[] buffers
 * @param index
 * @param pos
 * @param prev
 * @param next
 * @param counter
 * @param width
 * @param side
 */
private void setMemory(int index, Vector3f pos, Vector3f prev, Vector3f next, float counter, float width, float side){
    mPositions[index*3] = pos.x;
    mPositions[index*3+1] = pos.y;
    mPositions[index*3+2] = pos.z;

    mNext[index*3] = next.x;
    mNext[index*3+1] = next.y;
    mNext[index*3+2] = next.z;

    mPrevious[index*3] = prev.x;
    mPrevious[index*3+1] = prev.y;
    mPrevious[index*3+2] = prev.z;

    mCounters[index] = counter;
    mSide[index] = side;
    mWidth[index] = width;

}
 
Example #10
Source File: MainPanel.java    From javagame with MIT License 6 votes vote down vote up
/**
 * ������sceneBG�ɒlj�
 */
private void lightScene() {
    Color3f white = new Color3f(1.0f, 1.0f, 1.0f);

    // �‹����iAmbientLight�j
    // �ڂ���Ƃ������A���ꂪ�Ȃ��Ɛ^����
    AmbientLight ambientLight = new AmbientLight(white);
    ambientLight.setInfluencingBounds(bounds); // �����̋y�Ԕ͈͂�ݒ�
    sceneBG.addChild(ambientLight); // sceneBG�Ɍ�����lj�

    // ���s�����i�\�ʂ������ƌ���j
    Vector3f lightDirection = new Vector3f(-1.0f, -1.0f, -1.0f); // �����̌���
    DirectionalLight dirLight = new DirectionalLight(white, lightDirection);
    dirLight.setInfluencingBounds(bounds);
    sceneBG.addChild(dirLight);
}
 
Example #11
Source File: Skylight_BulletPhysics_CellFracture.java    From PixelFlow with MIT License 6 votes vote down vote up
public void addGround(){
  {
    Vector3f pos = new Vector3f(0,0,10);
    BObject obj = new BBox(this, 0, 650, 650, 20);
    BObject body = new BObject(this, 0, obj, pos, true);
    
    body.setPosition(pos);

    body.displayShape.setStroke(false);
    body.displayShape.setFill(true);
    body.displayShape.setFill(color(200, 96, 16));
    body.displayShape.setFill(color(255));
    body.displayShape.setStrokeWeight(1);
    body.displayShape.setStroke(color(0));
    if(obj instanceof BBox){
      fixBoxNormals(body.displayShape);
    }
    physics.addBody(body);
    group_bulletbodies.addChild(body.displayShape);
    body.displayShape.setName("ground_box");
  }
}
 
Example #12
Source File: Bezier3ControlPoint.java    From Robot-Overlord-App with GNU General Public License v2.0 5 votes vote down vote up
/**
 * visualize the line in opengl
 * @param gl2
 */
public void render(GL2 gl2) {
	//Vector3f u,v,w;
	
	//MatrixHelper.drawMatrix(gl2, position.interpolate(0), u, v, w);
	//MatrixHelper.drawMatrix(gl2, position.interpolate(1), u, v, w);
	boolean isLit = gl2.glIsEnabled(GL2.GL_LIGHTING);
	boolean isCM =  gl2.glIsEnabled(GL2.GL_COLOR_MATERIAL);
	boolean isDepth =  gl2.glIsEnabled(GL2.GL_DEPTH_TEST);

	gl2.glEnable(GL2.GL_DEPTH_TEST);
	gl2.glDisable(GL2.GL_LIGHTING);
	gl2.glDisable(GL2.GL_COLOR_MATERIAL);
	
	//*
	gl2.glColor4f(0, 0, 1, 1);
	gl2.glBegin(GL2.GL_LINES);
	gl2.glVertex3f(position.p0.x,position.p0.y,position.p0.z);
	gl2.glVertex3f(position.p1.x,position.p1.y,position.p1.z);
	
	gl2.glVertex3f(position.p2.x,position.p2.y,position.p2.z);
	gl2.glVertex3f(position.p3.x,position.p3.y,position.p3.z);
	gl2.glEnd();
	//*/
	
	gl2.glColor4f(0, 1, 0, 1);
	gl2.glBegin(GL2.GL_LINE_STRIP);
	final float NUM_STEPS=20;
	for(float i=0;i<=NUM_STEPS;++i) {
		Vector3f ipos = position.interpolate(i/NUM_STEPS);
		gl2.glVertex3f(ipos.x,ipos.y,ipos.z);
	}
	gl2.glEnd();
	
	if(isLit) gl2.glEnable(GL2.GL_LIGHTING);
	if(isCM) gl2.glEnable(GL2.GL_COLOR_MATERIAL);
	if(!isDepth) gl2.glDisable(GL2.GL_DEPTH_TEST);
}
 
Example #13
Source File: Skylight_BulletPhysics_MengerSponge.java    From PixelFlow with MIT License 5 votes vote down vote up
public void addGround(){
    {
      Vector3f pos = new Vector3f(0,0,10);
      BObject obj = new BBox(this, 0, 650, 650, 20);
      BObject body = new BObject(this, 0, obj, pos, true);
      
      body.setPosition(pos);
      
      body.rigidBody.setRestitution(.1f);
      body.rigidBody.setFriction(0.90f);
      body.rigidBody.setDamping(0.2f, 0.2f);
//      body.rigidBody.setHitFraction(0.081f);
  
      body.displayShape.setStroke(false);
      body.displayShape.setFill(true);
      body.displayShape.setFill(color(200, 96, 16));
      body.displayShape.setFill(color(255));
      body.displayShape.setStrokeWeight(1);
      body.displayShape.setStroke(color(0));
      if(obj instanceof BBox){
        fixBoxNormals(body.displayShape);
      }
      physics.addBody(body);
      group_bulletbodies.addChild(body.displayShape);
      body.displayShape.setName("ground_box");
    }
  }
 
Example #14
Source File: FWSmartItemModel.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
public FWSmartItemModel(Item item) {
	super();
	this.item = item;
	// Change the default transforms to the default Item transforms
	this.itemCameraTransforms = new net.minecraft.client.renderer.block.model.ItemCameraTransforms(
		new net.minecraft.client.renderer.block.model.ItemTransformVec3f(
			new Vector3f(0, -90, 130), new Vector3f(0, 1f / 24f, -2.75f / 16f), new Vector3f(0.9f, 0.9f, 0.9f)), // Third Person
		new net.minecraft.client.renderer.block.model.ItemTransformVec3f(
			new Vector3f(0, -135, 25/*-135/*-25*/), new Vector3f(0, 0.25f, 0.125f/*0.5f, 0.25f*/), new Vector3f(1.7f, 1.7f, 1.7f)), // First Person
		net.minecraft.client.renderer.block.model.ItemTransformVec3f.DEFAULT, // Head
		new net.minecraft.client.renderer.block.model.ItemTransformVec3f(
			new Vector3f(-30, 135, 0), new Vector3f(), new Vector3f(1.6F, 1.6F, 1.6F))); // GUI
}
 
Example #15
Source File: Stroke.java    From justaline-android with Apache License 2.0 5 votes vote down vote up
public void calculateTotalLength() {
    totalLength = 0;
    for (int i = 1; i < points.size(); i++) {
        Vector3f dist = new Vector3f(points.get(i));
        dist.sub(points.get(i - 1));
        totalLength += dist.length();
    }

}
 
Example #16
Source File: HullCollisionShape.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void createShape(float[] points) {
    ObjectArrayList<Vector3f> pointList = new ObjectArrayList<Vector3f>();
    for (int i = 0; i < points.length; i += 3) {
        pointList.add(new Vector3f(points[i], points[i + 1], points[i + 2]));
    }
    cShape = new ConvexHullShape(pointList);
    cShape.setLocalScaling(Converter.convert(getScale()));
    cShape.setMargin(margin);
}
 
Example #17
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java    From PixelFlow with MIT License 5 votes vote down vote up
public void scene1(){
  reset();
  
  float mass_mult = 0.33f;
  Vector3f window1_dim = new Vector3f(600, 300, 6);
  Vector3f window2_dim = new Vector3f(400, 500, 6);
  Vector3f window3_dim = new Vector3f(300, 600, 6);
  
  float[] window1_rgb = { 96,160,255};
  float[] window2_rgb = {255, 96, 32};
  float[] window3_rgb = {255,255,255};
 
  BreakableBody window1 = new BreakableBody(this, physics, group_bulletbodies);
  BreakableBody window2 = new BreakableBody(this, physics, group_bulletbodies);
  BreakableBody window3 = new BreakableBody(this, physics, group_bulletbodies);

  
  PMatrix3D win1_mat = new PMatrix3D();
  win1_mat.rotateX(90 * toRadians);
  win1_mat.translate(0, 20 + window1_dim.y*0.5f, 0);
  win1_mat.rotateY(-10 * toRadians);
  window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
  createFitting(win1_mat, window1_dim);
  
  PMatrix3D win2_mat = new PMatrix3D();
  win2_mat.rotateX(90 * toRadians);
  win2_mat.translate(0, 20 + window2_dim.y*0.5f, +150);
  window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
  createFitting(win2_mat, window2_dim);
  
  PMatrix3D win3_mat = new PMatrix3D();
  win3_mat.rotateX(90 * toRadians);
  win3_mat.translate(110, 20 + window3_dim.y*0.5f, -150);
  win3_mat.rotateY(10 * toRadians);
  window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
  createFitting(win3_mat, window3_dim);
}
 
Example #18
Source File: Skylight_BulletPhysics_CellFracture.java    From PixelFlow with MIT License 5 votes vote down vote up
public void removeLostBodies(){
  for(int i = physics.rigidBodies.size() - 1; i >= 0; i--){
    BObject body = physics.rigidBodies.get(i);
    Vector3f pos = body.getPosition();
    
    if(pos.z < -1000){
      int idx = group_bulletbodies.getChildIndex(body.displayShape);
      if(idx >= 0){
        group_bulletbodies.removeChild(idx);
      }
      physics.removeBody(body);
    }
  }
}
 
Example #19
Source File: FaceBakery.java    From The-5zig-Mod with MIT License 5 votes vote down vote up
private void a(Vector3f vector, clz var1) {
	if (var1 != null) {
		Matrix4d var2 = this.a();
		Vector3f var3 = new Vector3f(0.0F, 0.0F, 0.0F);
		switch (var1.b) {
			case a:
				var2.mul(a(new AxisAngle4d(1.0D, 0.0D, 0.0D, var1.c * 0.017453292519943295D)));
				var3.set(0.0F, 1.0F, 1.0F);
				break;
			case b:
				var2.mul(a(new AxisAngle4d(0.0D, 1.0D, 0.0D, var1.c * 0.017453292519943295D)));
				var3.set(1.0F, 0.0F, 1.0F);
				break;
			case c:
				var2.mul(a(new AxisAngle4d(0.0D, 0.0D, 1.0D, var1.c * 0.017453292519943295D)));
				var3.set(1.0F, 1.0F, 0.0F);
		}

		if (var1.d) {
			if (Math.abs(var1.c) == 22.5F) {
				var3.scale(fieldA);
			} else {
				var3.scale(fieldB);
			}

			var3.add(new Vector3f(1.0F, 1.0F, 1.0F));
		} else {
			var3.set(1.0F, 1.0F, 1.0F);
		}

		this.a(vector, new Vector3f(var1.a), var2, var3);
	}
}
 
Example #20
Source File: Skylight_BulletPhysics_TowerDemolition.java    From PixelFlow with MIT License 5 votes vote down vote up
public void removeLostBodies(){
  for(int i = physics.rigidBodies.size() - 1; i >= 0; i--){
    BObject body = physics.rigidBodies.get(i);
    Vector3f pos = body.getPosition();
    
    if(pos.z < -1000){
      int idx = group_bulletbodies.getChildIndex(body.displayShape);
      if(idx >= 0){
        group_bulletbodies.removeChild(idx);
      }
      physics.removeBody(body);
    }
  }
}
 
Example #21
Source File: Skylight_BulletPhysics_Cubes.java    From PixelFlow with MIT License 5 votes vote down vote up
public void removeLostBodies(){
  for(int i = physics.rigidBodies.size() - 1; i >= 0; i--){
    BObject body = physics.rigidBodies.get(i);
    Vector3f pos = body.getPosition();
    
    if(pos.z < -1000){
      int idx = group_bulletbodies.getChildIndex(body.displayShape);
      if(idx >= 0){
        group_bulletbodies.removeChild(idx);
      }
      physics.removeBody(body);
    }
  }
}
 
Example #22
Source File: PMDSkinVertData.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public PMDSkinVertData(DataInputStreamLittleEndian is) throws IOException{
    skinVertIndex = is.readInt();
    skinVertPos = new Vector3f();
    skinVertPos.x = is.readFloat();
    skinVertPos.y = is.readFloat();
    skinVertPos.z = -is.readFloat();
}
 
Example #23
Source File: NoiseGenerator.java    From Cleanstone with MIT License 5 votes vote down vote up
public void GradientPerturbFractal(Vector3f v3) {
    int seed = m_seed;
    float amp = m_gradientPerturbAmp * m_fractalBounding;
    float freq = m_frequency;

    SingleGradientPerturb(seed, amp, m_frequency, v3);

    for (int i = 1; i < m_octaves; i++) {
        freq *= m_lacunarity;
        amp *= m_gain;
        SingleGradientPerturb(++seed, amp, freq, v3);
    }
}
 
Example #24
Source File: Bezier3.java    From Robot-Overlord-App with GNU General Public License v2.0 5 votes vote down vote up
/**
 * interpolate along the path.  This code is slow, intuitive, and it works.
 * @param i 0...1 inclusive
 * @return the interpolated value along the path.
 */
public Vector3f interpolate(float i) {
	Vector3f pa = interpolate(p0,p1,i);
	Vector3f pb = interpolate(p1,p2,i);
	Vector3f pc = interpolate(p2,p3,i);
	
	Vector3f pab = interpolate(pa,pb,i);
	Vector3f pbc = interpolate(pb,pc,i);

	Vector3f result = interpolate(pab,pbc,i);
	return result;
}
 
Example #25
Source File: FastNoise.java    From FastNoise_Java with MIT License 5 votes vote down vote up
public void GradientPerturbFractal(Vector3f v3) {
	int seed = m_seed;
	float amp = m_gradientPerturbAmp * m_fractalBounding;
	float freq = m_frequency;

	SingleGradientPerturb(seed, amp, m_frequency, v3);

	for (int i = 1; i < m_octaves; i++) {
		freq *= m_lacunarity;
		amp *= m_gain;
		SingleGradientPerturb(++seed, amp, freq, v3);
	}
}
 
Example #26
Source File: DrawAR.java    From ar-drawing-java with Apache License 2.0 5 votes vote down vote up
/**
 * addStroke creates a new stroke
 *
 * @param newPoint a 3D point in world space
 */
private void addStroke(Vector3f newPoint) {
    biquadFilter = new BiquadFilter(mLineSmoothing);
    for (int i = 0; i < 1500; i++) {
        biquadFilter.update(newPoint);
    }
    Vector3f p = biquadFilter.update(newPoint);
    mLastPoint = new Vector3f(p);
    mStrokes.add(new ArrayList<Vector3f>());
    mStrokes.get(mStrokes.size() - 1).add(mLastPoint);
}
 
Example #27
Source File: PMDBone.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void readFromBuffer(ByteBuffer bb) {
    boneName = BufferUtil.readString(bb, 20);
    parentBoneIndex = bb.getShort();
    tailPosBoneIndex = bb.getShort();
    boneType = bb.get();
    targetBone = bb.getShort();
    boneHeadPos = new Vector3f(bb.getFloat(), bb.getFloat(), bb.getFloat());
    if (boneName.indexOf("ひざ") >= 0) {
        hiza = true;
    } else {
        hiza = false;
    }
}
 
Example #28
Source File: FaceBakery.java    From The-5zig-Mod with MIT License 5 votes vote down vote up
private void a(int[] dataIn, int var1, int count, Vector3f var3, int var4, cma blockPartFace) {
	int var7 = var1 * 7;
	dataIn[var7] = Float.floatToRawIntBits(var3.x);
	dataIn[var7 + 1] = Float.floatToRawIntBits(var3.y);
	dataIn[var7 + 2] = Float.floatToRawIntBits(var3.z);
	dataIn[var7 + 3] = var4;
	dataIn[var7 + 4] = Float.floatToRawIntBits(blockPartFace.a(count) / 16f);
	dataIn[var7 + 4 + 1] = Float.floatToRawIntBits(blockPartFace.b(count) / 16f);
}
 
Example #29
Source File: Skylight_BulletPhysics_Breakable3.java    From PixelFlow with MIT License 5 votes vote down vote up
public PShape createBoxShape(Vector3f dim){
  PShape shp = createShape(BOX, dim.x, dim.y, dim.z);
  shp.setStroke(false);
  shp.setFill(true);
  shp.setFill(color(16));
  shp.setStrokeWeight(1);
  shp.setStroke(color(0));
  return shp;
}
 
Example #30
Source File: FaceBakery.java    From The-5zig-Mod with MIT License 5 votes vote down vote up
public int a(Vector3f var, ej var1, int var2, cxf var3, boolean var4) {
	if (var3 == cxf.a) {
		return var2;
	} else {
		this.a(var, new Vector3f(0.5F, 0.5F, 0.5F), var3.a(), new Vector3f(1.0F, 1.0F, 1.0F));
		return var3.a(var1, var2);
	}
}