Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Gestalt.h
1// trax track library
2// AD 2024
3//
4// "A ghost is spirit without form. I believe what we're looking
5// for and what we're seeing here, is ... is form without spirit.
6// Something called a Golem."
7//
8// Agent Mulder
9//
10//
11// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
12// Copyright (c) 2019 Marc-Michael Horstmann
13//
14// Permission is hereby granted to any person obtaining a copy of this software
15// and associated source code (the "Software"), to use, view, and study the
16// Software for personal or internal business purposes, subject to the following
17// conditions:
18//
19// 1. Redistribution, modification, sublicensing, or commercial use of the
20// Software is NOT permitted without prior written consent from the copyright
21// holder.
22//
23// 2. The Software is provided "AS IS", without warranty of any kind, express
24// or implied.
25//
26// 3. All copies of the Software must retain this license notice.
27//
28// For further information, please contact: horstmann.marc@trendverlag.de
29
30#pragma once
31
85
86#include "Body.h"
87#include "Shape.h"
88
89namespace trax
90{
91
98 struct Gestalt : virtual Body,
99 virtual Shape
100 {
101 public:
102
103 // Gestalt's name:
104
109 virtual void SetName( const char* name ) noexcept = 0;
110
111
113 virtual const char* GetName() const noexcept = 0;
114
115 // Gestalt's pose:
116
122 virtual void SetFrame( const spat::Frame<Length,One>& frame ) noexcept = 0;
123
124
126 virtual void GetFrame( spat::Frame<Length,One>& frame ) const noexcept = 0;
127
128
129 using Shape::Attach;
130
139 virtual int Attach( std::unique_ptr<Geom> pGeom, Mass mass ) = 0;
140
141
144 virtual Mass GeomMass( int idx = 0 ) const = 0;
145
146 };
147}
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
STL namespace.
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
A dynamic object in physical space.
Definition Body.h:44
A Geom is used for collision detection. It differs from a Shape in that it defines the most simple el...
Definition Geom.h:50
A Gestalt is a Body with a Shape.
Definition Gestalt.h:100
virtual int Attach(std::unique_ptr< Geom > pGeom, Mass mass)=0
Attach a Geom with a dedicated mass to the Gestalt.
virtual void SetFrame(const spat::Frame< Length, One > &frame) noexcept=0
Sets position and orientation (pose) in global coordinates.
virtual Mass GeomMass(int idx=0) const =0
virtual const char * GetName() const noexcept=0
virtual void GetFrame(spat::Frame< Length, One > &frame) const noexcept=0
Gets the pose in global coordinates.
virtual void SetName(const char *name) noexcept=0
Sets the name of the Gestalt.
A Shape is a collection of Geoms.
Definition Shape.h:41