SuperDex Physics C++ API
Loading...
Searching...
No Matches
active_aniso_arap_params_inl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19// PLEASE DO NOT ADD OTHER INCLUDES HERE. This header is included in the mochi_physics public API.
20#include "active_aniso_arap_params.h" // Reverse include for intellisense
21
23
24namespace superdex {
25
27 return ATan2(anisoDir[2], anisoDir[0]);
28}
29
31 return ASin(anisoDir[1]);
32}
33
35 real const cosPhi = Cos(phi);
36 return {cosPhi * Cos(theta), Sin(phi), cosPhi * Sin(theta)};
37}
38
39} // namespace superdex
constexpr T Sin(T a)
constexpr T ATan2(T y, T x)
constexpr T Cos(T a)
NdArray< real, 3 > Real3
Definition nd_array.h:106
constexpr T ASin(T a)
real GetPhi() const
Returns the elevation angle (φ) [rad] from the stored fiber direction.
static constexpr Real3 ComputeFiberDirection(real theta, real phi)
Computes the fiber direction unit vector from spherical angles.
real GetTheta() const
Returns the azimuthal angle (θ) [rad] from the stored fiber direction.
Real3 anisoDir
Fiber direction as a unit vector: (cos(φ)cos(θ), sin(φ), cos(φ)sin(θ)).