Blender V4.3
matrix.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#ifndef __EIGEN3_MATRIX_C_API_CC__
10#define __EIGEN3_MATRIX_C_API_CC__
11
12/* Eigen gives annoying huge amount of warnings here, silence them! */
13#if defined(__GNUC__) && !defined(__clang__)
14# pragma GCC diagnostic ignored "-Wlogical-op"
15#endif
16
17#ifdef __EIGEN3_MATRIX_C_API_CC__
18/* Quiet warning. */
19#endif
20
21#include <Eigen/Core>
22#include <Eigen/Dense>
23
24#include "matrix.h"
25
26using Eigen::Map;
27using Eigen::Matrix4f;
28
29bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
30{
31 Map<Matrix4f> M = Map<Matrix4f>((float *)matrix);
32 Matrix4f R;
33 bool invertible = true;
34 M.computeInverseWithCheck(R, invertible, 0.0f);
35 if (!invertible) {
36 R = R.Zero();
37 }
38 memcpy(inverse, R.data(), sizeof(float) * 4 * 4);
39 return invertible;
40}
41
42#endif /* __EIGEN3_MATRIX_C_API_CC__ */
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Map
btMatrix3x3 inverse() const
Return the inverse of the matrix.
#define M
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
Definition matrix.cc:29
#define R