Sha256: 419ab55f321e7aca1bcaa0b9417a3a1486aa1a6bd0835ce6063e3c2f5309cd97

Contents?: true

Size: 1.64 KB

Versions: 42

Compression:

Stored size: 1.64 KB

Contents

// -*- c++ -*-
#pragma once
#ifndef __RAYS_COORD_H__
#define __RAYS_COORD_H__


#include <rays/defs.h>


namespace Rays
{


	struct Coord2
	{

		typedef Coord2 This;

		enum {SIZE = 2};

		union
		{
			struct {coord x, y;};
			struct {coord s, t;};
			coord array[SIZE];
		};

		Coord2& reset (coord value = 0);

		Coord2& reset (coord x, coord y);

		size_t size () const;

		String inspect () const;

		      coord& operator [] (size_t index);

		const coord& operator [] (size_t index) const;

	};// Coord2


	struct Coord3
	{

		typedef Coord3 This;

		enum {SIZE = 3};

		union
		{
			struct {coord x,   y,     z;};
			struct {coord s,   t,     p;};
			struct {coord r,   g,     b;};
			struct {coord red, green, blue;};
			coord array[SIZE];
		};

		This& operator = (const Coord2& rhs);

		Coord3& reset (coord value = 0);

		Coord3& reset (coord x, coord y, coord z = 0);

		size_t size () const;

		String inspect () const;

		      coord& operator [] (size_t index);

		const coord& operator [] (size_t index) const;

	};// Coord3


	struct Coord4
	{

		typedef Coord4 This;

		enum {SIZE = 4};

		union
		{
			struct {coord x,   y,     z,    w;};
			struct {coord s,   t,     p,    q;};
			struct {coord r,   g,     b,    a;};
			struct {coord red, green, blue, alpha;};
			coord array[SIZE];
		};

		This& operator = (const Coord2& rhs);

		This& operator = (const Coord3& rhs);

		Coord4& reset (coord value = 0);

		Coord4& reset (coord x, coord y, coord z = 0, coord w = 1);

		size_t size () const;

		String inspect () const;

		      coord& operator [] (size_t index);

		const coord& operator [] (size_t index) const;

	};// Coord4


}// Rays


#endif//EOH

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rays-0.1.34 include/rays/coord.h
rays-0.1.33 include/rays/coord.h
rays-0.1.32 include/rays/coord.h
rays-0.1.31 include/rays/coord.h
rays-0.1.30 include/rays/coord.h
rays-0.1.29 include/rays/coord.h
rays-0.1.28 include/rays/coord.h
rays-0.1.27 include/rays/coord.h
rays-0.1.26 include/rays/coord.h
rays-0.1.25 include/rays/coord.h
rays-0.1.24 include/rays/coord.h
rays-0.1.23 include/rays/coord.h
rays-0.1.22 include/rays/coord.h
rays-0.1.21 include/rays/coord.h
rays-0.1.20 include/rays/coord.h
rays-0.1.19 include/rays/coord.h
rays-0.1.18 include/rays/coord.h
rays-0.1.17 include/rays/coord.h
rays-0.1.16 include/rays/coord.h
rays-0.1.15 include/rays/coord.h