ObjFW
OFMatrix4x4.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
23 OF_SUBCLASSING_RESTRICTED
25 {
26  float _values[4][4];
27 }
28 
29 #ifdef OF_HAVE_CLASS_PROPERTIES
30 @property (readonly, class) OFMatrix4x4 *identityMatrix;
31 #endif
32 
38 @property (readonly, nonatomic) float (*values)[4];
39 
43 + (OFMatrix4x4 *)identityMatrix;
44 
51 + (instancetype)matrixWithValues: (const float [_Nonnull 4][4])values;
52 
53 - (instancetype)init OF_UNAVAILABLE;
54 
61 - (instancetype)initWithValues: (const float [_Nonnull 4][4])values
62  OF_DESIGNATED_INITIALIZER;
63 
70 - (void)multiplyWithMatrix: (OFMatrix4x4 *)matrix;
71 
77 - (void)translateWithVector: (OFVector3D)vector;
78 
84 - (void)scaleWithVector: (OFVector3D)vector;
85 
92 - (OFVector4D)transformedVector: (OFVector4D)vector;
93 @end
94 
95 OF_ASSUME_NONNULL_END
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
A 4x4 matrix of floats.
Definition: OFMatrix4x4.h:24
A protocol for the creation of copies.
Definition: OFObject.h:1346
A vector in 3D space.
Definition: OFObject.h:300
A vector in 4D space.
Definition: OFObject.h:352