Skip to content

Commit 368ad3b

Browse files
committed
Update CHANGELOG-v3.50.md
1 parent eb6d342 commit 368ad3b

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

CHANGELOG-v3.50.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,45 @@ The following are all of the new components and functions that made this possibl
444444

445445
### Mesh Game Object - New Features, Updates and API Changes
446446

447-
// TODO
448-
// Include RGB class
447+
The Mesh Game Object has been rewritten in v3.50 with a lot of changes to make it more useful and able to handle 3D objects:
448+
449+
* `Geom.Mesh.Vertex` is a new class that encapsulates all of the data required for a single vertex, including position, uv, color and alpha. This class is now created internally by the Mesh Game Object.
450+
* `Geom.Mesh.Face` is a new class that consists of references to the three `Vertex` instances that construct a single Face in a Mesh and provides methods for manipulating them.
451+
* The Mesh constructor and `MeshFactory` signatures have changed to `scene, x, y, texture, frame, vertices, uvs, indicies, colors, alphas`. Note the way the Texture and Frame parameters now comes first. `indicies` is a new parameter added to the list. It allows you to provide indexed vertex data to create the Mesh from, where the `indicies` array holds the vertex index information. The final list of vertices is built from this index along with the provided vertices and uvs arrays. The `indicies` array is optional. If your data is not indexed, then simply pass `null` or an empty array for this parameter.
452+
* The `Mesh` Game Object now extends the `SingleAlpha` component and the alpha value is factored into the final alpha value per vertex during rendering. This means you can now set the whole alpha across the Mesh using the standard `setAlpha` methods. But, if you wish to, you can still control the alpha on a per-vertex basis as well.
453+
* The `Mesh` Game Object now has the Animation State Component. This allows you to create and play animations across the texture of a Mesh, something that previously wasn't possible. As a result, the Mesh now adds itself to the Update List when added to a Scene.
454+
* `Geom.Mesh.ParseObj` is a new function that will parse a triangulated Wavefront OBJ file into model data that can be consumed by the Mesh Game Object.
455+
* `Loader.OBJFile` is a new File Loader type that can load triangulated Wavefront OBJ files, which are then parsed and stored in the OBJ Cache.
456+
* `Mesh.hideCCW` is a new boolean property that, when enabled, tells a Face to not render if it isn't counter-clockwise. You can use this to hide backward facing Faces.
457+
* `Mesh.addOBJ` is a new method that will add the model data from a loaded Wavefront OBJ file to a Mesh. You load it via the new `OBJFile` with a `this.load.obj` call, then you can use the key with the `addOBJ` method. This method also takes an optional scale and position parameters to control placement of the created model within the Mesh.
458+
* `Mesh.addModel` is a new method that will add the model data to a Mesh. You can prepare the model data yourself, pull it in from a server, or get it by calling `Geom.ParseObj`, or a similar custom function. This method also takes an optional scale and position parameters to control placement of the created model within the Mesh.
459+
* `Mesh.rotateX` is a new method that will rotate all vertices of the Mesh around the x axis, by the amount given. It then depth sorts the faces.
460+
* `Mesh.rotateY` is a new method that will rotate all vertices of the Mesh around the y axis, by the amount given. It then depth sorts the faces.
461+
* `Mesh.rotateZ` is a new method that will rotate all vertices of the Mesh around the z axis, by the amount given. It then depth sorts the faces.
462+
* `Mesh.depthSort` is a new method that will run a depth sort across all Faces in the Mesh by sorting them on their average depth.
463+
* `Mesh.addVertex` is a new method that allows you to add a new single Vertex into the Mesh.
464+
* `Mesh.addFace` is a new method that allows you to add a new Face into the Mesh. A Face must consist of 3 Vertex instances.
465+
* `Mesh.addVertices` is a new method that allows you to add vertices to a Mesh Game Object based on the given parameters. This allows you to modify a mesh post-creation, or populate it with data at a later stage.
466+
* `Mesh.getFaceCount` new is a new method that will return the total number of Faces in the Mesh.
467+
* `Mesh.getVertexCount` new is a new method that will return the total number of Vertices in the Mesh.
468+
* `Mesh.getFace` new is a new method that will return a Face instance from the Mesh based on the given index.
469+
* `Mesh.getFaceAt` new is a new method that will return an array of Face instances from the Mesh based on the given position. The position is checked against each Face, translated through the optional Camera and Mesh matrix. If more than one Face intersects, they will all be returned but the array will be depth sorted first, so the first element will be that closest to the camera.
470+
* `Mesh.vertices` is now an array of `GameObject.Vertex` instances, not a Float32Array.
471+
* `Mesh.faces` is a new array of `GameObject.Face` instances, which is populated during a call to methods like `addVertices` or `addModel`.
472+
* `Mesh.clearVertices` is a new method that will destroy all Faces and Vertices and clear the Mesh.
473+
* `Mesh.setDebug` is a new method that allows you to render a debug visualisation of the Mesh vertices to a Graphics Game Object. You can provide your own Graphics instance and optionally callback that is invoked during rendering. This allows you to easily visualise the vertices of your Mesh to help debug UV mapping.
474+
* The Mesh now renders by iterating through the Faces array, not the vertices. This allows you to use Array methods such as `BringToTop` to reposition a Face, thus changing the drawing order without having to repopulate all of the vertices. Or, for a 3D model, you can now depth sort the Faces.
475+
* The Mesh renderer will now check to see if the pipeline capacity has been exceeded for every Face added, allowing you to use Meshes with vertex counts that exceed the pipeline capacity without causing runtime errors.
476+
* You can now supply just a single numerical value as the `colors` parameter in the constructor, factory method and `addVertices` method. If a number, instead of an array, it will be used as the color for all vertices created.
477+
* You can now supply just a single numerical value as the `alphas` parameter in the constructor, factory method and `addVertices` method. If a number, instead of an array, it will be used as the alpha for all vertices created.
478+
* `Mesh.debugGraphic` is a new property that holds the debug Graphics instance reference.
479+
* `Mesh.debugCallback` is a new property that holds the debug render callback.
480+
* `Mesh.renderDebugVerts` is a new method that acts as the default render callback for `setDebug` if none is provided.
481+
* `Mesh.preDestroy` is a new method that will clean-up the Mesh arrays and debug references on destruction.
482+
* The `Mesh.uv` array has been removed. All UV data is now bound in the Vertex instances.
483+
* The `Mesh.colors` array has been removed. All color data is now bound in the Vertex instances.
484+
* The `Mesh.alphas` array has been removed. All color data is now bound in the Vertex instances.
485+
* The `Mesh.tintFill` property is now a `boolean` and defaults to `false`.
449486

450487
### Input / Mouse Updates and API Changes
451488

0 commit comments

Comments
 (0)