Skip to content

Commit

Permalink
Ran clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Nov 21, 2024
1 parent 2e42b7a commit e24a0b4
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 50 deletions.
16 changes: 7 additions & 9 deletions include/vsg/app/ViewMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ namespace vsg
/// scenes where standrd double precision is insufficient for avoiding visually significant numerical errors.
dvec3 origin;

virtual dmat4 transform(const vsg::dvec3& offset={}) const = 0;
virtual dmat4 transform(const vsg::dvec3& offset = {}) const = 0;

virtual dmat4 inverse(const vsg::dvec3& offset={}) const
virtual dmat4 inverse(const vsg::dvec3& offset = {}) const
{
return vsg::inverse(transform(offset));
}
Expand Down Expand Up @@ -88,7 +88,7 @@ namespace vsg

void set(const dmat4& matrix);

dmat4 transform(const dvec3& offset={}) const override;
dmat4 transform(const dvec3& offset = {}) const override;

void read(Input& input) override;
void write(Output& output) const override;
Expand All @@ -103,7 +103,6 @@ namespace vsg
class VSG_DECLSPEC LookDirection : public vsg::Inherit<ViewMatrix, LookDirection>
{
public:

LookDirection() :
position(0.0, 0.0, 0.0),
rotation()
Expand All @@ -124,11 +123,10 @@ namespace vsg

void set(const dmat4& matrix);

dmat4 transform(const dvec3& offset={}) const override;
dmat4 transform(const dvec3& offset = {}) const override;
};
VSG_type_name(vsg::LookDirection);


/// RelativeViewMatrix is a ViewMatrix that decorates another ViewMatrix and pre-multiplies its transform matrix to give a relative view matrix.
class VSG_DECLSPEC RelativeViewMatrix : public Inherit<ViewMatrix, RelativeViewMatrix>
{
Expand All @@ -140,7 +138,7 @@ namespace vsg
}

/// returns matrix * viewMatrix->transform()
dmat4 transform(const vsg::dvec3& offset={}) const override;
dmat4 transform(const vsg::dvec3& offset = {}) const override;

dmat4 matrix;
ref_ptr<ViewMatrix> viewMatrix;
Expand All @@ -163,8 +161,8 @@ namespace vsg
objectPath(path.begin(), path.end()) {}

/// returns matrix * computeTransfrom(objectPath)
dmat4 transform(const vsg::dvec3& offset={}) const override;
dmat4 inverse(const vsg::dvec3& offset={}) const override;
dmat4 transform(const vsg::dvec3& offset = {}) const override;
dmat4 inverse(const vsg::dvec3& offset = {}) const override;

dmat4 matrix;
RefObjectPath objectPath;
Expand Down
4 changes: 2 additions & 2 deletions include/vsg/core/Array3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ namespace vsg
VSG_array3D(svec2Array3D, svec2);
VSG_array3D(svec3Array3D, svec3);
VSG_array3D(svec4Array3D, svec4);

VSG_array3D(usvec2Array3D, usvec2);
VSG_array3D(usvec3Array3D, usvec3);
VSG_array3D(usvec4Array3D, usvec4);

VSG_array3D(ubvec2Array3D, ubvec2);
VSG_array3D(ubvec3Array3D, ubvec3);
VSG_array3D(ubvec4Array3D, ubvec4);
Expand Down
4 changes: 2 additions & 2 deletions include/vsg/maths/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ namespace vsg
}
};

using box = t_box<float>; /// float box class
using dbox = t_box<double>; /// double box class
using box = t_box<float>; /// float box class
using dbox = t_box<double>; /// double box class
using ldbox = t_box<long double>; /// double box class

VSG_type_name(vsg::box);
Expand Down
4 changes: 2 additions & 2 deletions include/vsg/maths/mat4.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ namespace vsg
const T* data() const { return value[0].data(); }
};

using mat4 = t_mat4<float>; /// float 4x4 matrix
using dmat4 = t_mat4<double>; /// double 4x4 matrix
using mat4 = t_mat4<float>; /// float 4x4 matrix
using dmat4 = t_mat4<double>; /// double 4x4 matrix
using ldmat4 = t_mat4<long double>; /// long double 4x4 matrix

VSG_type_name(vsg::mat4);
Expand Down
4 changes: 2 additions & 2 deletions include/vsg/maths/quat.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ namespace vsg
explicit operator bool() const noexcept { return value[0] != 0.0 || value[1] != 0.0 || value[2] != 0.0 || value[3] != 0.0; }
};

using quat = t_quat<float>; /// float quaternion
using dquat = t_quat<double>; /// double quaternion
using quat = t_quat<float>; /// float quaternion
using dquat = t_quat<double>; /// double quaternion
using ldquat = t_quat<long double>; /// long double quaternion

VSG_type_name(vsg::quat);
Expand Down
4 changes: 2 additions & 2 deletions include/vsg/maths/sphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ namespace vsg
}
};

using sphere = t_sphere<float>; /// float sphere class
using dsphere = t_sphere<double>; /// double sphere class
using sphere = t_sphere<float>; /// float sphere class
using dsphere = t_sphere<double>; /// double sphere class
using ldsphere = t_sphere<long double>; /// long double sphere class

VSG_type_name(vsg::sphere);
Expand Down
18 changes: 9 additions & 9 deletions include/vsg/maths/vec2.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ namespace vsg
explicit operator bool() const noexcept { return value[0] != 0.0 || value[1] != 0.0; }
};

using vec2 = t_vec2<float>; // float 2D vector
using dvec2 = t_vec2<double>; // double 2D vector
using ldvec2 = t_vec2<long double>; // long double 2D vector
using bvec2 = t_vec2<int8_t>; // signed 8 bit integer 2D vector
using svec2 = t_vec2<int16_t>; // signed 16 bit integer 2D vector
using ivec2 = t_vec2<int32_t>; // signed 32 bit integer 2D vector
using ubvec2 = t_vec2<uint8_t>; // unsigned 8 bit integer 2D vector
using usvec2 = t_vec2<uint16_t>; // unsigned 16 bit integer 2D vector
using uivec2 = t_vec2<uint32_t>; // unsigned 32 bit integer 2D vector
using vec2 = t_vec2<float>; // float 2D vector
using dvec2 = t_vec2<double>; // double 2D vector
using ldvec2 = t_vec2<long double>; // long double 2D vector
using bvec2 = t_vec2<int8_t>; // signed 8 bit integer 2D vector
using svec2 = t_vec2<int16_t>; // signed 16 bit integer 2D vector
using ivec2 = t_vec2<int32_t>; // signed 32 bit integer 2D vector
using ubvec2 = t_vec2<uint8_t>; // unsigned 8 bit integer 2D vector
using usvec2 = t_vec2<uint16_t>; // unsigned 16 bit integer 2D vector
using uivec2 = t_vec2<uint32_t>; // unsigned 32 bit integer 2D vector

VSG_type_name(vsg::vec2);
VSG_type_name(vsg::dvec2);
Expand Down
18 changes: 9 additions & 9 deletions include/vsg/maths/vec3.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ namespace vsg
explicit operator bool() const noexcept { return value[0] != 0.0 || value[1] != 0.0 || value[2] != 0.0; }
};

using vec3 = t_vec3<float>; // float 3D vector
using dvec3 = t_vec3<double>; // double 3D vector
using ldvec3 = t_vec3<long double>; // long double 3D vector
using bvec3 = t_vec3<int8_t>; // signed 8 bit integer 3D vector
using svec3 = t_vec3<int16_t>; // signed 16 bit integer 3D vector
using ivec3 = t_vec3<int32_t>; // signed 32 bit integer 3D vector
using ubvec3 = t_vec3<uint8_t>; // unsigned 8 bit integer 3D vector
using usvec3 = t_vec3<uint16_t>; // unsigned 16 bit integer 3D vector
using uivec3 = t_vec3<uint32_t>; // unsigned 32 bit integer 3D vector
using vec3 = t_vec3<float>; // float 3D vector
using dvec3 = t_vec3<double>; // double 3D vector
using ldvec3 = t_vec3<long double>; // long double 3D vector
using bvec3 = t_vec3<int8_t>; // signed 8 bit integer 3D vector
using svec3 = t_vec3<int16_t>; // signed 16 bit integer 3D vector
using ivec3 = t_vec3<int32_t>; // signed 32 bit integer 3D vector
using ubvec3 = t_vec3<uint8_t>; // unsigned 8 bit integer 3D vector
using usvec3 = t_vec3<uint16_t>; // unsigned 16 bit integer 3D vector
using uivec3 = t_vec3<uint32_t>; // unsigned 32 bit integer 3D vector

VSG_type_name(vsg::vec3);
VSG_type_name(vsg::dvec3);
Expand Down
18 changes: 9 additions & 9 deletions include/vsg/maths/vec4.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ namespace vsg
explicit operator bool() const noexcept { return value[0] != 0.0 || value[1] != 0.0 || value[2] != 0.0 || value[3] != 0.0; }
};

using vec4 = t_vec4<float>; // float 4D vector
using dvec4 = t_vec4<double>; // double 4D vector
using ldvec4 = t_vec4<long double>; // long double 4D vector
using bvec4 = t_vec4<int8_t>; // signed 8 bit integer 4D vector
using svec4 = t_vec4<int16_t>; // signed 16 bit integer 4D vector
using ivec4 = t_vec4<int32_t>; // signed 32 bit integer 4D vector
using ubvec4 = t_vec4<uint8_t>; // unsigned 8 bit integer 4D vector
using usvec4 = t_vec4<uint16_t>; // unsigned 16 bit integer 4D vector
using uivec4 = t_vec4<uint32_t>; // unsigned 32 bit integer 4D vector
using vec4 = t_vec4<float>; // float 4D vector
using dvec4 = t_vec4<double>; // double 4D vector
using ldvec4 = t_vec4<long double>; // long double 4D vector
using bvec4 = t_vec4<int8_t>; // signed 8 bit integer 4D vector
using svec4 = t_vec4<int16_t>; // signed 16 bit integer 4D vector
using ivec4 = t_vec4<int32_t>; // signed 32 bit integer 4D vector
using ubvec4 = t_vec4<uint8_t>; // unsigned 8 bit integer 4D vector
using usvec4 = t_vec4<uint16_t>; // unsigned 16 bit integer 4D vector
using uivec4 = t_vec4<uint32_t>; // unsigned 32 bit integer 4D vector

VSG_type_name(vsg::vec4);
VSG_type_name(vsg::dvec4);
Expand Down
2 changes: 1 addition & 1 deletion src/vsg/app/RecordTraversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <vsg/lighting/SpotLight.h>
#include <vsg/maths/plane.h>
#include <vsg/nodes/Bin.h>
#include <vsg/nodes/CoordinateFrame.h>
#include <vsg/nodes/CullGroup.h>
#include <vsg/nodes/CullNode.h>
#include <vsg/nodes/DepthSorted.h>
Expand All @@ -35,7 +36,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <vsg/nodes/LOD.h>
#include <vsg/nodes/Layer.h>
#include <vsg/nodes/MatrixTransform.h>
#include <vsg/nodes/CoordinateFrame.h>
#include <vsg/nodes/PagedLOD.h>
#include <vsg/nodes/QuadGroup.h>
#include <vsg/nodes/RegionOfInterest.h>
Expand Down
4 changes: 2 additions & 2 deletions src/vsg/app/ViewMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void LookDirection::set(const dmat4& matrix)

dmat4 LookDirection::transform(const dvec3& offset) const
{
return vsg::rotate(-rotation) * vsg::translate(offset-origin-position);
return vsg::rotate(-rotation) * vsg::translate(offset - origin - position);
}

dmat4 RelativeViewMatrix::transform(const dvec3& offset) const
Expand All @@ -72,7 +72,7 @@ dmat4 RelativeViewMatrix::transform(const dvec3& offset) const

dmat4 TrackingViewMatrix::transform(const dvec3& offset) const
{
return matrix * vsg::translate(offset-origin) * vsg::inverse(computeTransform(objectPath));
return matrix * vsg::translate(offset - origin) * vsg::inverse(computeTransform(objectPath));
}

dmat4 TrackingViewMatrix::inverse(const dvec3& offset) const
Expand Down
2 changes: 1 addition & 1 deletion src/vsg/utils/Intersector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <vsg/nodes/VertexDraw.h>
#include <vsg/nodes/VertexIndexDraw.h>
#include <vsg/state/GraphicsPipeline.h>
#include <vsg/utils/Intersector.h>
#include <vsg/text/CpuLayoutTechnique.h>
#include <vsg/text/GpuLayoutTechnique.h>
#include <vsg/utils/Intersector.h>

using namespace vsg;

Expand Down

0 comments on commit e24a0b4

Please sign in to comment.