-
Notifications
You must be signed in to change notification settings - Fork 44
/
MRMovementBuildBody.h
31 lines (26 loc) · 1010 Bytes
/
MRMovementBuildBody.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include "MRMeshFwd.h"
#include "MRVector3.h"
#include <optional>
namespace MR
{
struct MovementBuildBodyParams
{
/// if this flag is set, rotate body in trajectory vertices
/// according to its rotation
/// otherwise body movement will be done without any rotation
bool allowRotation{ true };
/// point around which body is rotated (if allowRotation)
/// if not set body bounding box center is used
std::optional<Vector3f> rotationCenter;
/// facing direction of body, used for initial rotation (if allowRotation)
/// if not set body accumulative normal is used
std::optional<Vector3f> bodyNormal;
/// optional transform trajectory space to body space
const AffineXf3f* t2bXf{ nullptr };
};
/// makes mesh by moving `body` along `trajectory`
/// if allowRotation rotate it in corners
[[nodiscard]] MRMESH_API Mesh makeMovementBuildBody( const Contours3f& body, const Contours3f& trajectory,
const MovementBuildBodyParams& params = {} );
}