Consolidate all Vertex and Index buffer creation inside the
Mesh class. Users now set data pointers in the MeshData
from which the Mesh class will create the filament buffers.
PiperOrigin-RevId: 895871213
Change-Id: Ie086fcb5c31adf90e54cba168b03501e21720726
A future change will update all callers to use this
method for creating Meshes after which we will remove
the constructor that takes explicit filament objects.
PiperOrigin-RevId: 895807063
Change-Id: I50833817961ae57fbb9ed6b875c1ef286b9fdd26
Update the Mesh class so that it manages the lifetime of the
vertex and index buffers.
PiperOrigin-RevId: 895794022
Change-Id: I5eda578b8b7ed7f918e792f6181ec724729b5215
TextureConfig describes the properties of the texture (e.g.
width, height, pixel format, etc.). TextureData contains
the binary payload of the texture.
PiperOrigin-RevId: 892854578
Change-Id: I604b926ac38ff1050cac8fdf9ec767b789c0798e
All objects that are specific to the mjModel (meshes, textures, etc.)
are now managed by a ModelObjects class which is owned by the SceneView
and not the FilamentContext.
PiperOrigin-RevId: 892250776
Change-Id: Iddad66fd3ab1a60c4becdcb5d0c935ed9ea8ad90
Separate out the parts of the FilamentContext initialization that
depends on the mjModel into a separate Init function.
PiperOrigin-RevId: 890373341
Change-Id: I06b524668cd60dad804d437958f4f6606c46200b
Setting values in the mjrContext is only useful for the classic
renderer.
PiperOrigin-RevId: 890345656
Change-Id: Ie3d34dc260d13f74b569dcf575e88dde894d652b
Add a warning in user_model.cc if a flex is not rigid and has no edge equality constraints or passive forces (edge stiffness, edge damping, or vertex damping). Such flexes would not affect the simulation. A test case is added to verify the warning.
PiperOrigin-RevId: 889215981
Change-Id: I481128e1456921b632719547c676d201fdfbe931
Reflective surfaces (planes) use a custom shader to blend their
texture with a texture that contains the reflected image. The
reflected image is rendered to a texture as a separate render
pass in the SceneView.
Because reflective textures are generated after the preparation
phase, additional functions are needed to reapply the texture
to the drawable.
PiperOrigin-RevId: 889213413
Change-Id: I7bad39d62e3e5ba38cf6ac667fec5b87bfa7b2a2
A future CL will implement reflective surfaces and make use of these materials.
PiperOrigin-RevId: 889200524
Change-Id: Icbe5c0c390f89789ed0f5d5c6058a2ef31105608
Add a new mjpEncoder plugin type mirroring the existing mjpDecoder pattern.
Encoders serialize an mjSpec + mjModel to an mjResource for a given format.
New API functions:
- mjp_registerEncoder: globally register an encoder
- mjp_defaultEncoder: zero-initialize an encoder struct
- mjp_findEncoder: look up an encoder by filename extension or content type
The mjfEncode callback takes (mjSpec*, mjModel*, mjVFS*, mjResource*) and
returns 0 on success. Writing to mjResource keeps symmetry with the decoder
reading from mjResource and leaves the door open for writable resource providers.
PiperOrigin-RevId: 889187898
Change-Id: I180771b2255b91dea188ac5e2cdc3a8f0fb85364
The computation of tactile sensor values for each taxel is now parallelized using the MuJoCo threadpool when the number of taxels exceeds a threshold. Each thread processes a batch of taxels, accumulating forces from all colliding geoms.
PiperOrigin-RevId: 888606457
Change-Id: I98abf3e98a7318fc14080054bea7093ab46e8b8b
The `vertcollide` attribute in flex and flexcomp contact specifications has been removed since the next mjWarp release will support flex collisions. This attribute was previously used to enable vertex-based collisions by adding sphere geoms at flex vertices. The functionality associated with this attribute has been deprecated and removed from the XML parser, documentation, and internal data structures. Affected example XML files have also been updated.
PiperOrigin-RevId: 885595503
Change-Id: I6a78975f1bc540c09ea8b5306ff3be0962b7ab24
model_holder.cc modified to disable multi-threaded compilation for WASM builds. index.html `animate()` function modified so the animation rendering loop executes asynchronously with async/await calls. These changes are sufficient to make xml files without references work (e.g., humanoid.xml), more work is needed to make the vfs work so multi-file models can load.
PiperOrigin-RevId: 885537402
Change-Id: I3469cae48e7268073be334b99bf907c5ed8c27a7
When freeing a stack frame, only poison the newly-freed memory region
`[old_top, new_top)` instead of the entire region `[limit, top)`. The old
code redundantly re-poisoned already-poisoned memory on every
`mj_freeStack` call.
Benchmarking `engine_forward_test` under ASAN:
- Before: 99.3s
- After: 75.6s (~24% faster)
PiperOrigin-RevId: 885035750
Change-Id: Ib195661ca337d13c5ff6094bcc107c4c0a617b9b