Commit graph

86 commits

Author SHA1 Message Date
Richard Davey
57974c120a Updated docs 2020-10-05 17:12:18 +01:00
Richard Davey
7aaf77a2c6 Merged the Mesh Game Object back in 2020-10-05 16:52:01 +01:00
Richard Davey
333945a89e Remove Mesh Game Object and add Layer3D 2020-09-21 18:24:38 +01:00
Richard Davey
33734309f1 Clean the mesh after rendering 2020-09-21 15:57:21 +01:00
Richard Davey
989e3e6e07 Swapped to use RGB objects 2020-09-21 15:57:11 +01:00
Richard Davey
82c8ada236 Added fog, dirty refresh and preUpdate handler 2020-09-21 15:56:58 +01:00
Richard Davey
78c1eb7934 Removed debug, modified signatuers, added fog 2020-09-21 00:17:58 +01:00
Richard Davey
374cc84be8 Now the pipeline does it all 2020-09-18 17:52:41 +01:00
Richard Davey
561a1b54a2 Handle vertex normals too 2020-09-18 17:52:30 +01:00
Richard Davey
640ce49d93 Update MeshCamera.js 2020-09-18 17:52:20 +01:00
Richard Davey
6e62ada207 Created new MeshLight class 2020-09-18 17:52:15 +01:00
Richard Davey
5b8e490c7e Flush during render so we can have models with more vertices than the batch allows 2020-09-17 18:08:25 +01:00
Richard Davey
5ff9894925 MeshCamera now supports orbit and pan modes 2020-09-17 18:08:07 +01:00
Richard Davey
6ce58ed73b Let them define the orientation 2020-09-17 10:08:15 +01:00
Richard Davey
c5412df09e Fix docs 2020-09-16 17:48:56 +01:00
Richard Davey
c306229478 Final JSDocs 2020-09-16 17:33:17 +01:00
Richard Davey
1d0b5cc6a9 Added Size component 2020-09-16 17:15:37 +01:00
Richard Davey
a38166ce2b Now allows a texture per model, not mesh 2020-09-16 16:39:06 +01:00
Richard Davey
851775ae19 New MeshCamera class 2020-09-16 16:38:39 +01:00
Richard Davey
8ff008b740 Removed un-used components, refactored method names and added MeshCamera 2020-09-16 16:38:32 +01:00
Richard Davey
da6a300474 Iterates and renders the new models array 2020-09-16 13:51:39 +01:00
Richard Davey
4f7442ee96 Moving all dependencies to the Model object 2020-09-16 13:51:30 +01:00
Richard Davey
a96d380933 Created new Geom.Mesh namespace for all of the Mesh related functions and classes 2020-09-16 13:50:36 +01:00
Richard Davey
45412157c2 Added JSDocs 2020-09-16 09:50:24 +01:00
Richard Davey
b74928b2f8 Added hideCCW, addOBJ, addModel, sortByDepth, rotateX, rotateY, rotateZ, depthSort, addVertex and addFace methods. 2020-09-15 18:09:19 +01:00
Richard Davey
431eb69b42 Much cleaner rendering function, skipping invalid faces 2020-09-15 18:07:51 +01:00
Richard Davey
3e133c900a New method signature order 2020-09-15 18:07:24 +01:00
Richard Davey
a2a199818e Added contains and isCounterClockwise methods and depth property 2020-09-15 18:07:14 +01:00
Richard Davey
229d27dc9e Updated docs and added load method 2020-09-15 18:06:48 +01:00
Richard Davey
d8a8aa8448 Added clearVertices and renamed to addVertices so you can append on more verts post-creation 2020-09-15 11:57:44 +01:00
Richard Davey
b763fa0f18 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. 2020-09-15 11:57:22 +01:00
Richard Davey
92982d810b Added ability to get InCenter. translate and rotate Face 2020-09-14 17:35:06 +01:00
Richard Davey
52d5b00fe5 Added setPosition and translate methods 2020-09-14 17:34:47 +01:00
Richard Davey
6a966e3f3b Removed interpolationPercentage parameter from all render methods, as it has never been used. 2020-09-14 15:33:58 +01:00
Richard Davey
1057ead114 Dump all of the old mega arrays and replace with an array of Vertex instances. 2020-09-14 15:09:34 +01:00
Richard Davey
6a3ce21702 GameObject.Face is a new micro class that consists of references to the three Vertex instances that construct the single Face. 2020-09-14 15:08:36 +01:00
Richard Davey
8fc969088c GameObject.Vertex is a new micro class that encapsulates all of the data required for a single vertex, such as position, uv, color and alpha. This class is now created internally by the Mesh Game Object. 2020-09-14 15:08:25 +01:00
Richard Davey
8d25510b61 GameObjects.GetCalcMatrix is a new function that is used to calculate the transformed Game Object matrix, based on the given Game Object, Camera and Parent. This function is now used by the following Game Objects: BitmapText (Static and Dynamic), Graphics, Mesh, Rope, Shader, Arc, Curve, Ellipse, Grid, IsoBox, IsoTriangle, Line, Polygon, Rectangle, Star and Triangle. This dramatically reduces the amount of duplicate code across the API. 2020-09-14 15:01:40 +01:00
Richard Davey
25b5c2d1d1 Loads of new Mesh updates
* `Mesh.setVertices` is a new method that allows you to set the verts of a Mesh Game Object from the given parameters. This allows you to modify a mesh post-creation, or populate it with data at a later stage.
* The Mesh constructor signature has changed to `scene, x, y, vertices, uvs, indicies, colors, alphas, texture, frame`, where `indicies` is the 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.
* You can now supply just a single numerical value as the `color` parameter in the constructor, factory method and `setVertices` method. If a number, instead of an array, it will be used as the color for all vertices created.
* You can now supply just a single numerical value as the `alpha` parameter in the constructor, factory method and `setVertices` method. If a number, instead of an array, it will be used as the alpha for all vertices created.
* 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.
* 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.
* `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.
* `Mesh.debugGraphic` is a new property that holds the debug Graphics instance reference.
* `Mesh.debugCallback` is a new property that holds the debug render callback.
* `Mesh.renderDebugVerts` is a new method that acts as the default render callback for `setDebug` if none is provided.
* `Mesh.preDestroy` is a new method that will clean-up the Mesh arrays and debug references on destruction.
2020-09-13 23:11:04 +01:00
Richard Davey
3fd52ecdd3 Added debug draw 2020-09-13 17:16:17 +01:00
Richard Davey
d198818d80 Game Objects now call the new Pipeline Manager methods directly 2020-09-09 13:05:18 +01:00
Richard Davey
71d85be0df Mesh and Quad Game Objects now support rendering with normal maps. 2020-07-16 15:25:06 +01:00
Richard Davey
ec0914cd0f The Mesh Game Object WebGL Renderer function has been updated to support multi-texture units. 2020-07-15 16:53:09 +01:00
Richard Davey
dea68135fd Correct texture type. Fix #5199 2020-07-13 13:29:01 +01:00
Richard Davey
ff65e69cd1 Changed copyright date to 2020 2020-01-15 12:07:09 +00:00
Richard Davey
752999c92b The Mesh and Quad Game Objects have had the GetBounds component removed as it cannot operate on a Mesh as they don't have origins. Fix #4902 2019-12-18 14:43:23 +00:00
Richard Davey
c91ed91ce3 License link update 2019-05-10 16:15:04 +01:00
Richard Davey
e017691c68 The ScaleMode Component has been removed from every Game Object, and along with it the scaleMode property and setScaleMode method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 2019-03-24 23:07:27 +00:00
Richard Davey
05e3520048 The Mesh.setAlpha method has been restored, even though it's empty and does nothing, to prevent runtime errors when adding a Mesh or Quad object to a Container. Fix #4338 #4343 2019-02-06 23:36:05 +00:00
Richard Davey
aa341854c7 Happy New Year 2019-01-15 16:20:22 +00:00