Add specialized vector types for float vectors

This commit is contained in:
Renaud Casenave-Péré 2014-01-02 19:52:47 +09:00
parent 48d6456f0e
commit 7731809a8a
4 changed files with 52 additions and 1 deletions

16
src/maths/float2.lisp Normal file
View file

@ -0,0 +1,16 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float2
(:nicknames :float2 :f2)
(:use :cl)
(:export :float2 :vec))
(in-package :stoe.maths.float2)
(deftype float2 () '(simple-array single-float (2)))
(defun vec (x y)
(v:vec x y))

16
src/maths/float3.lisp Normal file
View file

@ -0,0 +1,16 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float3
(:nicknames :float3 :f3)
(:use :cl)
(:export :float3 :vec))
(in-package :stoe.maths.float3)
(deftype float3 () '(simple-array single-float (3)))
(defun vec (x y z)
(v:vec x y z))

16
src/maths/float4.lisp Normal file
View file

@ -0,0 +1,16 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float4
(:nicknames :float4 :f4)
(:use :cl)
(:export :float4 :vec))
(in-package :stoe.maths.float4)
(deftype float4 () '(simple-array single-float (4)))
(defun vec (x y z w)
(v:vec x y z w))

View file

@ -24,7 +24,10 @@
((:module "maths"
:components
((:file "maths")
(:file "vector")))
(:file "vector")
(:file "float2")
(:file "float3")
(:file "float4")))
(:file "utils")
(:file "thread"
:depends-on ("utils"))