File: float4.cpp

package info (click to toggle)
spring 106.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 55,260 kB
  • sloc: cpp: 543,946; ansic: 44,800; python: 12,575; java: 12,201; awk: 5,889; sh: 1,796; asm: 1,546; xml: 655; perl: 405; php: 211; objc: 194; makefile: 76; sed: 2
file content (20 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#include "System/float4.h"
#include "System/creg/creg_cond.h"
#include "System/SpringMath.h"

CR_BIND(float4, )
CR_REG_METADATA(float4, (CR_MEMBER(x), CR_MEMBER(y), CR_MEMBER(z), CR_MEMBER(w)))

// ensure that we use a continuous block of memory
// (required for passing to gl functions)
static_assert(sizeof(float4) == 4 * sizeof(float), "");

bool float4::operator == (const float4& f) const
{
	#define eps float3::cmp_eps()
	return (epscmp(x, f.x, eps) && epscmp(y, f.y, eps) && epscmp(z, f.z, eps) && epscmp(w, f.w, eps));
	#undef eps
}