Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
422cbb3
[core] Fix IndexedGeometry.
dlyr Jul 20, 2022
1b830fd
[engine] Prepare API of GeometryDisplayable
nmellado Jul 19, 2021
e61a3b8
[engine] add GeometryDisplayableComponent
dlyr Mar 31, 2022
2a7d992
[tests] Use GeometryDisplayableComponent in HelloRadium (nothing draw…
dlyr Mar 31, 2022
9a70370
[core] Switch struct -> class for AbstractGeometry.
dlyr Jul 20, 2022
2667d0a
[core] Use macro for clone implementation.
dlyr Jul 20, 2022
7b382f1
[engine] double wireframe (ad hoc for quad mesh).
dlyr Jul 20, 2022
d9bf89c
[core][engine] Use demangleType.
dlyr Sep 15, 2022
5964da4
[engine] user BijectiveAssociation for translation table.
dlyr Sep 18, 2022
9c2ded2
[core][engine] Move triangulate to core.
dlyr Sep 18, 2022
78107af
[engine] Add empty ctor.
dlyr Sep 18, 2022
949d2ac
[engine] use geometrydisplayable for components.
dlyr Sep 18, 2022
749b41b
[engine] fix geometry component (after rebase)
dlyr Apr 27, 2025
45c2967
[engine] rename correspondance -> matching
dlyr Sep 18, 2022
3c84cc2
[engine] GeometrySystem use GeometryDisplayable comp.
dlyr Sep 18, 2022
6b64c6c
[examples] Start using GeometryDisplayable in draw prim.
dlyr Sep 18, 2022
1b0815e
[engine] GeometryComponent clean include.
dlyr Sep 19, 2022
6512f61
[engine] Renderer remove debug print.
dlyr Sep 19, 2022
9ad560e
[engine] handle line index layer picking render mode.
dlyr Sep 19, 2022
c728ad4
[core] MeshPrimitives remove debug print.
dlyr Sep 19, 2022
bc6889b
[core] IndexedGeometry remove debug print.
dlyr Sep 19, 2022
f3b7cc0
[examples] HelloRadium remove debug print.
dlyr Sep 19, 2022
e9a6f95
[engine] Remove unused LineMeshComponent.
dlyr Oct 27, 2022
d6237d9
[examples] add fixed light in skinning example.
dlyr Dec 8, 2022
36ff8fe
[core] use inverse transpose for normal lbs.
dlyr Dec 8, 2022
1d1e14e
[core] comment typo in trianglemesh
dlyr Dec 8, 2022
60ce865
[core][engine] use AttribArrayGeometry as skinning data.
dlyr Dec 8, 2022
2aa0a2a
[core] register rw on AttribArrayGeometry for SurfaceMeshComponent.
dlyr Dec 8, 2022
0f1a771
[core] Temporary remove non working file from base code.
dlyr May 16, 2023
38c6286
[core] Remove dead code.
dlyr May 3, 2025
ce3381a
[core] Add missing include for std_any.
dlyr May 3, 2025
c2e1066
[engine] Add setter for active layer.
dlyr May 3, 2025
969142c
[engine] Use GeometryDisplayable for DrawPrimitive::Triangle.
dlyr May 3, 2025
df5ff4b
[engine] Remove LineMesh (use GeometryDisplayable instead).
dlyr May 3, 2025
cdfa0a0
[examples] Use GeometryDisplayable for Poly example.
dlyr May 3, 2025
9bdb07c
[engine] Sphere use GeometryDisplayable.
dlyr May 4, 2025
c833e42
[engine] Fix set render mode when set active key (to update picking r…
dlyr May 4, 2025
51d2a16
[core][engine] Move grid to mesh primitives, small refactor also.
dlyr May 5, 2025
845148c
[core] *Mesh are now using aliases to IndexedGeometry<>.
dlyr May 5, 2025
46d5ce3
[engine] Fix priority to rm triangles fill draw primitives.
dlyr May 5, 2025
bc737c8
[engine] Add createMeshFromGeometry2 for geometry displayable.
dlyr May 5, 2025
e01dbb5
[examples] create GeometryDisplayable instead of AttribArrayDisplayab…
dlyr May 5, 2025
5edc761
[engine][core][gui] Use QuadMesh and GeometryDisplayable for Torus an…
dlyr May 6, 2025
131efe2
[core][engine] Add FanOrStrip, Disk use GeometryDisplayable.
dlyr May 6, 2025
6611d85
[core] Factorize index layer code using macro.
dlyr May 6, 2025
04970ff
[core] Add offset to append for GeometryIndexLayer.
dlyr May 6, 2025
824525f
[engine] Add triangle layer to disc (not only fan) for wireframe.
dlyr May 6, 2025
e59c176
[core] Typo in comment.
dlyr Apr 21, 2026
1a26770
[core] Cleanup and remove duplicate code in TopologicalMesh.
dlyr Apr 21, 2026
a5cf93c
[core][...] Rename TriangleMesh.?pp to AttribArayGeometry.?pp
dlyr Apr 21, 2026
227791e
[core] wip on attrib geom in skinning
dlyr Apr 21, 2026
14d1e7b
[core] Add default layer key (init as invalid) to multi index geom.
dlyr May 8, 2026
55a1bad
[core] Switch skinnig reference mesth to multiindexgeometry.
dlyr May 8, 2026
09e2e6e
[engine] Clean includes and remove commented code in Skinning.
dlyr May 8, 2026
ca45fbc
[core] Refactor indexed geometry (comments, inline).
dlyr May 8, 2026
8aea033
[core] Simpler init of default key, reset when deep clear.
dlyr May 8, 2026
106a4bb
[core] Clean and refactor RayCastTriangleMesh.
dlyr May 8, 2026
29b361b
[tests] Add MultiIndexGeometry default_layer_key test.
dlyr May 8, 2026
39e8111
[engine] Some autos and addAttrib for GeometryDisplayable.
dlyr May 8, 2026
be4a379
[tests] more multi index test.
dlyr May 8, 2026
4c59ac7
[examples] Add strip to all primitives.
dlyr May 9, 2026
e628e02
[core] Add doc for makeGrid.
dlyr May 9, 2026
c40a5d5
[examples] Add textured quad strip to DrawPrimitives.
dlyr May 9, 2026
1839c8b
[core] Refactor makePlaneGrid.
dlyr May 9, 2026
6da62e6
[core] Add operator<< on std::set helper.
dlyr May 9, 2026
1926ae8
[engine] QuadStrip use makePlaneGrid.
dlyr May 9, 2026
139475c
[engine] Mesh output error if layer not added.
dlyr May 9, 2026
c50500f
[engine] Handle wireframe when there isn't any triangle layer.
dlyr May 9, 2026
f65931c
[core][engine][example] Add aabb mesh primitive.
dlyr May 10, 2026
da19105
[core] Obb is core Aabb instead of in class using.
dlyr May 10, 2026
f5fcf87
[Engine] Do not draw wireframe if RO is already in line mode.
dlyr May 10, 2026
2431b4b
[gui] Set pivot on alt right clic.
dlyr May 10, 2026
41d32fa
[core] Add makeBox2, prepare transition.
dlyr May 10, 2026
12d5c9b
[examples] DrawPrimitives add cube from makeBox2.
dlyr May 10, 2026
a74cc03
[core] Template indexed geometry with layer type instead of index.
dlyr May 10, 2026
8cda994
[core] Add indices/set_indices templated function.
dlyr May 10, 2026
ca8d7cc
[core] set_indices add layer if needed.
dlyr May 11, 2026
d598b63
[engine] Use MultiIndexedGeometry instead of old Mesh or LineMesh.
dlyr May 11, 2026
7ec5516
[examples] DrawPrimitives, add spline and line strip.
dlyr May 11, 2026
260f040
[engine] Remove deprecated MeshPtr, LineMesh->MultiIndexedGeometry.
dlyr May 11, 2026
2caa7b5
[core] Remove explicit from MultiIndexedGeometry copy ctor.
dlyr May 11, 2026
4e048c4
[core] Remove explicit call to copy ctor.
dlyr May 11, 2026
c83d4fb
[core] indices_with_lock return pair with layer_key to unlockLayer.
dlyr May 11, 2026
f2c9dbb
[core] Everything (?) is MultiIndexed.
dlyr May 11, 2026
d594fab
[engine] Draw primitive auto (for TriangleMesh->MultiIndexed).
dlyr May 11, 2026
e1ee91e
[gui] Guizmo geom use MultiIndexed.
dlyr May 11, 2026
78946ec
[tests] Update tests according to Indexed->MultiIndexed.
dlyr May 11, 2026
513cf1b
[gui] Move gizmo todo to viewer (where it's instancied).
dlyr May 12, 2026
58e9d31
[gui] Add todo to todo comment.
dlyr May 12, 2026
7090cc0
[core] Fix MultiIndexGeometry append bad offset.
dlyr May 12, 2026
11b450f
[gizmo] Add empty line for readability.
dlyr May 12, 2026
c01ae5c
[engine] Remove Mesh component alias, everything is SurfaceMesh.
dlyr May 12, 2026
6cacd42
[examples] Update according to SurfaceMeshComponent.
dlyr May 12, 2026
e19aac5
[doc] Wip update mesh documentation.
dlyr May 12, 2026
61bfde5
[core][engine] Move triangulate function in Helper namespace.
dlyr May 12, 2026
92967e3
[core] Add a triangulate method that create a triangle layer.
dlyr May 12, 2026
a27b9ab
[core] Add some constness (and const overload) to topomesh.
dlyr May 12, 2026
4c3651f
[tests] topomesh use makeBox2 (e.g. with MultiIndexed, with Quad).
dlyr May 12, 2026
9dcee93
[core] Remove unneeded inline keyword in topomesh.
dlyr May 12, 2026
8639a1a
[examples] Use makeSharpBox2 when appropriate.
dlyr May 13, 2026
5cf4229
[engine] Some mesh type update, and sharpBox2.
dlyr May 13, 2026
84b8eae
[core] Append new layer always unlocked (since a copy).
dlyr May 13, 2026
5db8a9f
[gui] Gizmo triangulate before append.
dlyr May 13, 2026
baf43f5
[gui] SimpleWindow, add quit action and connect to shortcut.
dlyr May 13, 2026
c8a064c
[examples] Add quit action to minimalapp.
dlyr May 13, 2026
70cd8a9
[tests] topo mesh sharpBox2.
dlyr May 13, 2026
05d1ce1
[core] Indexed geom triangulate_any and comments.
dlyr May 14, 2026
4c50a78
[engine] use bracket include.
dlyr May 14, 2026
7d016f5
[gui] Gizmo use triangulate_any.
dlyr May 14, 2026
902774c
[examples] Switch to makeSharpBox2
dlyr May 15, 2026
e56ee79
[engine] VolumeObject Mesh -> GeometryDisplayable.
dlyr May 15, 2026
1870c72
[core] Include StdUtils to cout set if needed.
dlyr May 15, 2026
6d6633f
[tests] Update index view using MultiIndexedGeometry.
dlyr May 15, 2026
7517a50
[core][engine][...] Remove template from param sphere and torus.
dlyr May 16, 2026
8231958
[core] Move makeParametricShpere (and Torus) implem to .cpp.
dlyr May 16, 2026
47b73a9
[engine] iwyu (since core implem move to .cpp).
dlyr May 16, 2026
0bc4cf1
[core] use MultiIndexGeometry for makeGrid.
dlyr May 16, 2026
545f426
[core] Remove old make*Box.
dlyr May 16, 2026
606ed17
[core] Rename Box2 -> Box.
dlyr May 16, 2026
a82d7c5
[engine][gui][...] Rename Box2 -> Box.
dlyr May 16, 2026
38e1630
[core] makePlaneGrid returns MultiIndexGeometry.
dlyr May 16, 2026
5e4110a
[examples] TriMesh -> MultiIndexedGeometry.
dlyr May 16, 2026
4880829
[engine] Continue update, remove some LineMesh.
dlyr May 16, 2026
a63b143
[examples] PolyMesh -> MultiIndexed.
dlyr May 16, 2026
3adda47
[engine] LineMesh -> MultiIndexed.
dlyr May 16, 2026
df22c6f
[engine] DrawPrimitives, remove ref to TriangleMesh and LineMesh.
dlyr May 16, 2026
e2149d3
[engine] Use MultiIndexed for bone shape.
dlyr May 17, 2026
b8c8588
[examples] Load directly geom from geomData.
dlyr May 17, 2026
c7c73ba
[engine] Remove templated SurfaceMeshComponentBase.
dlyr May 17, 2026
19ce21f
[engine] Mesh remove deprecated General,Poly,Triangle,Quad -Mesh.
dlyr May 17, 2026
9e2893f
[engine] Remove deprecated, refactor inline ...
dlyr May 17, 2026
0350d6d
[engine] Remove deprecated Mesh.
dlyr May 17, 2026
fa66dff
[core] Change ref to TriangleMesh:: by MultiIndexedGeometry or Index
dlyr May 17, 2026
dbeff53
[core] Remove ref to deprecated.
dlyr May 17, 2026
90c9c4a
[tests] Get rid of lasts TriangleMesh in tests.
dlyr May 18, 2026
8d2fc31
[core] Replace TriangleMesh by MultiIndexed equiv.
dlyr May 18, 2026
0bc5e08
[core] Refactor semantics, use std helper in IndexedGeometry.
dlyr May 18, 2026
5004611
[*] Some comments, revome deprecadted point cloud, /*! -> /**.
dlyr May 18, 2026
bd9793f
[core] Remove conversion ctor
dlyr May 21, 2026
9d16fe6
[core] Remove using redefinition in derived class.
dlyr May 21, 2026
73c54ff
[core] Remove redundant inline in indexed geometry.
dlyr May 21, 2026
a6b689d
[engine] Add missing SurfaceMeshComponent ctor.
dlyr May 21, 2026
f9180b9
[gui] Add missing include.
dlyr May 29, 2026
90ee00d
[io] Recenter point cloud data (wip, need to add control on this).
dlyr Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Shaders/Lines/Wireframe.geom.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ in vec4 vPosition[2];
out vec4 gColor;
out float pixelWidthDiv2;
uniform vec2 viewport;
uniform float pixelWidth;
vec4 vColor[2];

void main() {
Expand All @@ -34,7 +35,6 @@ void main() {
vec4 scss1 = css1 * css0.w;

vec3 dir = ( scss1 - scss0 ).xyz;
float pixelWidth = 1.8;
const float border = 4.;
vec3 slope = normalize( vec3( -dir.y, dir.x, 0 ) );
vec4 n = vec4( vec3( pixelWidth + border ) / vp * slope, 0 );
Expand Down
8 changes: 4 additions & 4 deletions doc/concepts/mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

# Geometry types

(todo update according to MultiIndexedGeometry)
There is three kind of geometry representation included in radium source :

1. Ra::Core::Geometry::*, which handles geometry data and connectivity as a indexed vertex array.
Each vertex is a unique set of position, normal, and other attributes.
If indexed, faces are defined with VectorXui, where X is 1 for point, 2 for lines, 3 for triangles, and N for polygons.
See inheritance diagram of Ra::Core::Geometry::AbstractGeometry :
- Ra::Core::Geometry::AttribArrayGeometry
- Ra::Core::Geometry::MultiIndexedGeometry*
- Ra::Core::Geometry::IndexedGeometry
- Ra::Core::Geometry::LineStrip *
- Ra::Core::Geometry::PointCloud *
Expand All @@ -20,14 +22,12 @@ See inheritance diagram of Ra::Core::Geometry::AbstractGeometry :
2. Ra::Core::Geometry::TopologicalMesh, which is an half-edge data structure.
A converter allows to go back and forth to `TriangleMesh`
without loss of data, but during the conversion, vertices with the same position represents the same topological point (and are hence merged).
**Soon deprecated:** The other vertex attributes are stored on half-edges (to manage multiple normals per 3D positions
for instance).
**New:** The other vertex attributes are stored on wedges. Each half-edge has one wedge index. If multiple half-edge have the same set of attributes (including vertex position) they have the same wedge index at construction. See section [wedges](#wedges) below.
The other vertex attributes are stored on wedges. Each half-edge has one wedge index. If multiple half-edge have the same set of attributes (including vertex position) they have the same wedge index at construction. See section [wedges](#wedges) below.
3. Ra::Engine::Data::*, which stores a Core Geometry to handle 3D data, and manages the rendering aspect of it (VAO, VBO, draw call).
See inheritance diagram of Ra::Engine::Data::AttribArrayDisplayable
- Ra::Engine::Data::Displayable
- Ra::Engine::Data::AttribArrayDisplayable
- Ra::Engine::Data::CoreGeometryDisplayable
- Ra::Engine::Data::GeometryDisplayable *
- Ra::Engine::Data::PointCloud *
- Ra::Engine::Data::IndexedGeometry
- Ra::Engine::Data::IndexedAttribArrayDisplayable
Expand Down
2 changes: 1 addition & 1 deletion examples/CustomCameraManipulator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
auto c =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Register the entity/component association to the geometry system ]
Expand Down
315 changes: 224 additions & 91 deletions examples/DrawPrimitives/AllPrimitivesComponent.cpp

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions examples/DrawPrimitives/minimalapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ void MinimalApp::initialize( const glbinding::Version& version ) {
m_viewer_widget->setAutoFillBackground( false );
m_viewer_widget->resize( 500, 500 );
m_viewer_widget->show();

auto quit_action = new QAction( this );
quit_action->setShortcuts( { QKeySequence::Close, QKeySequence::Quit } );
connect( quit_action, &QAction::triggered, this, &QApplication::quit );
m_viewer_widget->addAction( quit_action );

return;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/EntityAnimation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
// component ownership is transfered to entity in component ctor
new Scene::TriangleMeshComponent( "Fixed cube geometry", e, std::move( cube ), nullptr );
new Scene::SurfaceMeshComponent( "Fixed cube geometry", e, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]
}
//! [Create the demo fixed entity/component]
Expand All @@ -141,7 +141,7 @@ int main( int argc, char* argv[] ) {
// an animated yellow cube
auto cube =
Geometry::makeSharpBox( { 0.1f, 0.1f, 0.1f }, Ra::Core::Utils::Color::Yellow() );
new Scene::TriangleMeshComponent( "Fixed cube geometry", e, std::move( cube ), nullptr );
new Scene::SurfaceMeshComponent( "Fixed cube geometry", e, std::move( cube ), nullptr );

// an animated camera, thay is not the one active at startup. Use key '0' to activate
auto camera = new Scene::CameraComponent( e, "Animated Camera" );
Expand Down
2 changes: 1 addition & 1 deletion examples/EnvMap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int main( int argc, char* argv[] ) {
//! [Create the engine entity for the cube]

//! [Create a geometry component with the cube]
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Place the camera away from the cube]
Expand Down
2 changes: 1 addition & 1 deletion examples/HelloRadium/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
auto c =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Register the entity/component association to the geometry system ]
Expand Down
12 changes: 7 additions & 5 deletions examples/KeyEvent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/**
* Simple custom windows for custom KeyEvent demonstration
*/
using Ra::Core::Geometry::makeSharpBox;

class DemoWindow : public Ra::Gui::SimpleWindow
{
Q_OBJECT
Expand Down Expand Up @@ -74,19 +76,19 @@ class DemoWindow : public Ra::Gui::SimpleWindow
//! [Manage KeyEvent reaching the window]
/// Custom Key event management method
void colorup() {
auto& mesh = dynamic_cast<Ra::Core::Geometry::TriangleMesh&>(
auto& mesh = dynamic_cast<Ra::Core::Geometry::MultiIndexedGeometry&>(
m_obj->getMesh()->getAbstractGeometry() );
m_colIdx = ( m_colIdx + 1 ) % 10;
mesh.colorize( m_colors[m_colIdx] );
}
void colordown() {
auto& mesh = dynamic_cast<Ra::Core::Geometry::TriangleMesh&>(
auto& mesh = dynamic_cast<Ra::Core::Geometry::MultiIndexedGeometry&>(
m_obj->getMesh()->getAbstractGeometry() );
m_colIdx = ( m_colIdx + 9 ) % 10;
mesh.colorize( m_colors[m_colIdx] );
}
void colorreset() {
auto& mesh = dynamic_cast<Ra::Core::Geometry::TriangleMesh&>(
auto& mesh = dynamic_cast<Ra::Core::Geometry::MultiIndexedGeometry&>(
m_obj->getMesh()->getAbstractGeometry() );
m_colIdx = 0;
mesh.colorize( m_colors[m_colIdx] );
Expand Down Expand Up @@ -135,7 +137,7 @@ int main( int argc, char* argv[] ) {
//! [Creating the application]

//! [Creating the cube]
auto cube = Ra::Core::Geometry::makeSharpBox( { 0.1f, 0.1f, 0.1f } );
auto cube = makeSharpBox( { 0.1f, 0.1f, 0.1f } );
//! [Creating the cube]

//! [Colorize the Cube]
Expand All @@ -150,7 +152,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
auto c =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Register the entity/component association to the geometry system ]
Expand Down
2 changes: 1 addition & 1 deletion examples/Picking/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void addDummyScene( Ra::Gui::BaseApplication& app ) {
auto cube = Ra::Core::Geometry::makeSharpBox( { 0.1f, 0.1f, 0.1f } );
auto e = app.m_engine->getEntityManager()->createEntity( "Cube" );
auto c =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", e, std::move( cube ), nullptr );

auto geometrySystem = app.m_engine->getSystem( "GeometrySystem" );
geometrySystem->addComponent( e, c );
Expand Down
3 changes: 1 addition & 2 deletions examples/RawShaderMaterial/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ std::shared_ptr<Ra::Engine::Rendering::RenderObject> initQuad( Ra::Gui::BaseAppl
Ra::Core::Asset::RawShaderMaterialData mat { "Quad Material", _config1, paramProvider };

//! [Create a geometry component using the custom material]
auto c =
new Ra::Engine::Scene::TriangleMeshComponent( "Quad Mesh", e, std::move( quad ), &mat );
auto c = new Ra::Engine::Scene::SurfaceMeshComponent( "Quad Mesh", e, std::move( quad ), &mat );

//! [Register the entity/component association to the geometry system ]
auto system = app.m_engine->getSystem( "GeometrySystem" );
Expand Down
19 changes: 10 additions & 9 deletions examples/SimpleAnimation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@
* - Add the animation component to the animation system
*
*/
class KeyFramedGeometryComponent : public Ra::Engine::Scene::TriangleMeshComponent
class KeyFramedGeometryComponent : public Ra::Engine::Scene::SurfaceMeshComponent
{
public:
/*!
/**
* Constructor from an existing core mesh
* \warning Moves the mesh and takes its ownership
*/
inline KeyFramedGeometryComponent( const std::string& name,
Ra::Engine::Scene::Entity* entity,
Ra::Core::Geometry::TriangleMesh&& mesh ) :
Ra::Engine::Scene::TriangleMeshComponent( name,
entity,
std::move( mesh ),
new Ra::Core::Asset::BlinnPhongMaterialData {} ),
inline KeyFramedGeometryComponent(
const std::string& name,
Ra::Engine::Scene::Entity* entity,
Ra::Engine::Scene::SurfaceMeshComponent::CoreMeshType&& mesh ) :
Ra::Engine::Scene::SurfaceMeshComponent( name,
entity,
std::move( mesh ),
new Ra::Core::Asset::BlinnPhongMaterialData {} ),
m_transform( 0_ra, Ra::Core::Transform::Identity() ) {
//! [Creating the transform KeyFrames]
Ra::Core::Transform T = Ra::Core::Transform::Identity();
Expand Down
12 changes: 11 additions & 1 deletion examples/SimpleSkinning/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
#include <Engine/FrameInfo.hpp>
#include <Engine/RadiumEngine.hpp>
#include <Engine/Scene/CameraManager.hpp>
#include <Engine/Scene/DefaultLightManager.hpp>
#include <Engine/Scene/DirLight.hpp>
#include <Engine/Scene/EntityManager.hpp>
#include <Engine/Scene/GeometryComponent.hpp>
#include <Engine/Scene/SkeletonBasedAnimationSystem.hpp>
#include <Engine/Scene/SkeletonComponent.hpp>
#include <Engine/Scene/SkinningComponent.hpp>
#include <Engine/Scene/System.hpp>
#include <Engine/Scene/SystemDisplay.hpp>
#include <Gui/BaseApplication.hpp>
#include <Gui/RadiumWindow/SimpleWindowFactory.hpp>
#include <Gui/Viewer/Viewer.hpp>
Expand Down Expand Up @@ -71,6 +74,13 @@ class SkinningSystem : public Scene::System
};

void setupScene( Ra::Engine::RadiumEngine* engine ) {

DefaultLightManager* lightManager =
static_cast<DefaultLightManager*>( engine->getSystem( "DefaultLightManager" ) );
auto light = new Engine::Scene::DirectionalLight(
Ra::Engine::Scene::SystemEntity::getInstance(), "light" );
lightManager->addLight( light );

auto animationSystem = new SkinningSystem;
engine->registerSystem( "Simple animation system", animationSystem );

Expand All @@ -81,7 +91,7 @@ void setupScene( Ra::Engine::RadiumEngine* engine ) {

// component ownership is transfered to entity in component ctor
auto meshComponent =
new TriangleMeshComponent( "Cylinder", entity, std::move( cylinder ), nullptr );
new SurfaceMeshComponent( "Cylinder", entity, std::move( cylinder ), nullptr );

// create a squeleton with three bones.
std::map<std::string, Core::Transform> boneMatrices;
Expand Down
2 changes: 1 addition & 1 deletion examples/TexturedQuad/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main( int argc, char* argv[] ) {
textureHandle );

// the entity get's this new component ownership. A bit wired since hidden in ctor.
new Ra::Engine::Scene::TriangleMeshComponent( "Quad Mesh", e, std::move( quad ), material );
new Ra::Engine::Scene::SurfaceMeshComponent( "Quad Mesh", e, std::move( quad ), material );
//! [Create an entity and component to draw or data]

app.m_mainWindow->prepareDisplay();
Expand Down
2 changes: 1 addition & 1 deletion examples/TexturedQuadDynamic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main( int argc, char* argv[] ) {
material->setSpecularColor( Ra::Core::Utils::Color::Black() );

// the entity get's this new component ownership. a bit wired since hidden in ctor.
new Ra::Engine::Scene::TriangleMeshComponent( "Quad Mesh", e, std::move( quad ), material );
new Ra::Engine::Scene::SurfaceMeshComponent( "Quad Mesh", e, std::move( quad ), material );
//! [Create an entity and component to draw or data]

//! [Tell the window that something is to be displayed]
Expand Down
4 changes: 2 additions & 2 deletions examples/Volume/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
auto cc =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", ce, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", ce, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Register the entity/component association to the geometry system ]
Expand Down Expand Up @@ -125,7 +125,7 @@ int main( int argc, char* argv[] ) {

//! [Create a geometry component with the cube]
auto cc =
new Ra::Engine::Scene::TriangleMeshComponent( "Cube Mesh", ce, std::move( cube ), nullptr );
new Ra::Engine::Scene::SurfaceMeshComponent( "Cube Mesh", ce, std::move( cube ), nullptr );
//! [Create a geometry component with the cube]

//! [Register the entity/component association to the geometry system ]
Expand Down
5 changes: 2 additions & 3 deletions src/Core/Animation/LinearBlendSkinning.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <Core/Animation/HandleArray.hpp>
#include <Core/Animation/HandleWeight.hpp>
#include <Core/Animation/LinearBlendSkinning.hpp>
#include <Core/Animation/Skeleton.hpp>
#include <Core/Animation/SkinningData.hpp>
Expand Down Expand Up @@ -43,9 +41,10 @@ void linearBlendSkinning( const SkinningRefData& refData,
const Scalar w = it.value();
// prepare the pose w.r.t. the bind matrix and the mesh transform
const Transform M = refData.m_meshTransformInverse * pose[j] * bindMatrix[j];
const Matrix3 N = M.matrix().inverse().transpose().block<3, 3>( 0, 0 );
// apply LBS
frameData.m_currentPosition[i] += w * ( M * vertices[i] );
frameData.m_currentNormal[i] += w * ( M.linear() * normals[i] );
frameData.m_currentNormal[i] += w * ( N * normals[i] );
frameData.m_currentTangent[i] += w * ( M.linear() * tangents[i] );
frameData.m_currentBitangent[i] += w * ( M.linear() * bitangents[i] );
}
Expand Down
5 changes: 3 additions & 2 deletions src/Core/Animation/RotationCenterSkinning.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "Core/Geometry/IndexedGeometry.hpp"
#include <Core/Animation/RotationCenterSkinning.hpp>

#include <array>
Expand Down Expand Up @@ -52,9 +53,9 @@ void computeCoR( SkinningRefData& dataInOut, Scalar sigma, Scalar weightEpsilon
//

// convert the mesh to TopologicalMesh for easy processing.
Geometry::TriangleMesh triMesh;
Geometry::MultiIndexedGeometry triMesh;
triMesh.copy( dataInOut.m_referenceMesh );
Geometry::TopologicalMesh topoMesh( triMesh );
Geometry::TopologicalMesh topoMesh( triMesh, triMesh.default_layer_key() );

// hashing function for Vector3
struct hash_vec {
Expand Down
5 changes: 3 additions & 2 deletions src/Core/Animation/SkinningData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <Core/Animation/HandleWeight.hpp>
#include <Core/Animation/Pose.hpp>
#include <Core/Animation/Skeleton.hpp>
#include <Core/Geometry/TriangleMesh.hpp>
#include <Core/Geometry/AttribArrayGeometry.hpp>
#include <Core/Geometry/IndexedGeometry.hpp>
#include <Core/RaCore.hpp>

namespace Ra {
Expand All @@ -13,7 +14,7 @@ namespace Animation {
/// \brief Skinning data that get set at startup including the "reference state".
struct SkinningRefData {
/// The mesh in reference position.
Geometry::TriangleMesh m_referenceMesh;
Core::Geometry::MultiIndexedGeometry m_referenceMesh;

/// The inverse of the mesh's transform.
Transform m_meshTransformInverse;
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Asset/GeometryData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
#include <Core/Asset/AssetData.hpp>
#include <Core/Asset/MaterialData.hpp>
#include <Core/Containers/VectorArray.hpp>
#include <Core/Geometry/AttribArrayGeometry.hpp>
#include <Core/Geometry/IndexedGeometry.hpp>
#include <Core/Geometry/StandardAttribNames.hpp>
#include <Core/Geometry/TriangleMesh.hpp>
#include <Core/RaCore.hpp>
#include <Core/Types.hpp>
#include <Core/Utils/Attribs.hpp>
Expand Down Expand Up @@ -139,6 +140,7 @@ class RA_CORE_API GeometryData : public AssetData
GeometryType m_type;

/// Named attributes
/// \todo switch to shared ptr ?
Core::Geometry::MultiIndexedGeometry m_geometry;

/// Simple tracking of geometric primitive number
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Asset/MaterialData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Asset {
* Material data must be identified by a unique name.
* Radium Engine reserves the following names
* "AbstractMaterial" --> unknown material, might serve for error management
* "BlinnPhong" --> standar Blinn-Phong Material
* "BlinnPhong" --> standard Blinn-Phong Material
*
* When extending the material system with a loader plugin (or something similar) :
* Define your own "Asset" class derived from Ra::Core::Asset::MaterialData with the "type"
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Containers/AdjacencyList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RA_CORE_API AdjacencyList
void pruneLeaves( std::vector<uint>& pruned, std::vector<bool>& delete_flag );
/// Prune the leaves of the graph.
void pruneLeaves();
/*!
/**
* Return the edge list built from the given adjacency list.
* If include_leaf is true, the list will contain the pairs:
* ...
Expand Down
4 changes: 2 additions & 2 deletions src/Core/CoreMacros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ using Scalar = float;
using Scalar = double;
#endif

/*!
/**
* User litteral for Radium's Scalar type for floating point numbers
* \see https://en.cppreference.com/w/cpp/language/user_literal
* To create a Scalar from a litteral float, do:
Expand All @@ -272,7 +272,7 @@ constexpr Scalar operator"" _ra ( long double n )
return Scalar( n );
}

/*!
/**
* \brief User litteral for Radium's Scalar type for floating point numbers
* \see https://en.cppreference.com/w/cpp/language/user_literal
* To create a Scalar from a litteral, do:
Expand Down
Loading
Loading