public void update() { getWorldTransform().setScaling(getWorldTransform().getLocalScaling()); for(Node child: getChildren()) child.update(); }
public TerrainQuadtree(Map<NodeComponentType, NodeComponent> components, int rootChunkCount, float horizontalScaling) { super(); Transform worldTransformFace0 = new Transform(); worldTransformFace0.setTranslation(-0.5f * horizontalScaling, 0, -0.5f * horizontalScaling); worldTransformFace0.setScaling(horizontalScaling); for (int i=0; i<rootChunkCount; i++){ for (int j=0; j<rootChunkCount; j++){ addChild(createChildChunk(components, quadtreeCache, worldTransformFace0, new Vec2f(1f * i/(float)rootChunkCount,1f * j/(float)rootChunkCount), 0, new Vec2f(i,j))); } } }
public QuadtreeChunk(Map<NodeComponentType, NodeComponent> components, QuadtreeCache quadtreeCache, Transform worldTransform, Vec2f location, int lod, Vec2f index){ addComponent(NodeComponentType.CONFIGURATION, components.get(NodeComponentType.CONFIGURATION)); terrainProperties = getComponent(NodeComponentType.CONFIGURATION); this.quadtreeCache = quadtreeCache; this.isleaf = true; this.index = index; this.lod = lod; this.location = location; this.gap = 1f/(terrainProperties.getRootChunkCount() * (float)(Math.pow(2, lod))); Vec3f localScaling = new Vec3f(gap,0,gap); Vec3f localTranslation = new Vec3f(location.getX(),0,location.getY()); getLocalTransform().setScaling(localScaling); getLocalTransform().setTranslation(localTranslation); setWorldTransform(worldTransform); computeWorldPos(); }
public UIElement(int xPos, int yPos, int xScaling, int yScaling){ super(); setOrthographicMatrix(new Matrix4f().Orthographic2D()); getWorldTransform().setTranslation(xPos, yPos, 0); getWorldTransform().setScaling(xScaling, yScaling, 0); setOrthographicMatrix(getOrthographicMatrix().mul(getWorldTransform().getWorldMatrix())); }
0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace0.setRotation(-90f, 0f, 0f); worldTransformFace0.setScaling(horizontalScaling); 0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace1.setRotation(-90, 90, 0); worldTransformFace1.setScaling(horizontalScaling); 0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace2.setRotation(-90, 180, 0); worldTransformFace2.setScaling(horizontalScaling); 0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace3.setRotation(-90, -90, 0); worldTransformFace3.setScaling(horizontalScaling); worldTransformFace4.setTranslation(-0.5f * horizontalScaling, 0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace4.setScaling(horizontalScaling); worldTransformFace5.setTranslation(-0.5f * horizontalScaling, -0.5f * horizontalScaling, -0.5f * horizontalScaling); worldTransformFace5.setScaling(horizontalScaling);
public Ocean() { super(128, OceanBRDFShader.getInstance(), OceanWireframeShader.getInstance()); getWorldTransform().setScaling(Constants.ZFAR,1,Constants.ZFAR); getWorldTransform().setTranslation(-Constants.ZFAR/2,0,-Constants.ZFAR/2); setClip_offset(4); setClipplane(new Vec4f(0,-1,0,getWorldTransform().getTranslation().getY() + getClip_offset())); }
Vec3f localTranslation = new Vec3f(location.getX(),0,location.getY()); getLocalTransform().setScaling(localScaling); getLocalTransform().setTranslation(localTranslation); getWorldTransform().getLocalTranslation().setY(0); getWorldTransform().setScaling(getWorldTransform().getLocalScaling()); getWorldTransform().setTranslation(getWorldTransform().getLocalTranslation());
texturePanel0.getOrthoTransform().setScaling(200,200,0); texturePanel0.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel0.getOrthoTransform().getWorldMatrix())); texturePanel0.setSpacing(0.06f); texturePanel1.getOrthoTransform().setScaling(400,400,0); texturePanel1.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel1.getOrthoTransform().getWorldMatrix())); texturePanel1.setSpacing(0.0f); texturePanel2.getOrthoTransform().setScaling(250,250,0); texturePanel2.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel2.getOrthoTransform().getWorldMatrix())); texturePanel2.setSpacing(0.2f); texturePanel3.getOrthoTransform().setScaling(200,200,0); texturePanel3.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel3.getOrthoTransform().getWorldMatrix())); texturePanel3.setSpacing(0.4f); texturePanel4.getOrthoTransform().setScaling(100,100,0); texturePanel4.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel4.getOrthoTransform().getWorldMatrix())); texturePanel4.setSpacing(0.6f); texturePanel5.getOrthoTransform().setScaling(100,100,0); texturePanel5.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel5.getOrthoTransform().getWorldMatrix())); texturePanel5.setSpacing(0.8f); texturePanel6.getOrthoTransform().setScaling(100,100,0); texturePanel6.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel6.getOrthoTransform().getWorldMatrix())); texturePanel6.setSpacing(1.1f); texturePanel7.getOrthoTransform().setScaling(100,100,0);
sceneGraph.getWorldTransform().setScaling(1,-1,1); sceneGraph.update(); sceneGraph.getRoot().record(offScreenReflectionRenderList); sceneGraph.getWorldTransform().setScaling(1,1,1); sceneGraph.update(); sceneGraph.getRoot().record(offScreenRefractionRenderList);
offScreenReflecRefracFbo = VkContext.getResources().getOffScreenReflectionFbo(); getWorldTransform().setScaling(Constants.ZFAR,1,Constants.ZFAR); getWorldTransform().setTranslation(-Constants.ZFAR/2,0,-Constants.ZFAR/2);
scenegraph.getWorldTransform().setScaling(1,-1,1); scenegraph.getWorldTransform().setScaling(1,1,1);