001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019/*
020*
021
022Licensed under the Apache License, Version 2.0 (the "License");
023you may not use this file except in compliance with the License.
024You may obtain a copy of the License at
025
026   http://www.apache.org/licenses/LICENSE-2.0
027
028Unless required by applicable law or agreed to in writing, software
029distributed under the License is distributed on an "AS IS" BASIS,
030WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
031See the License for the specific language governing permissions and
032limitations under the License.
033*/
034
035package lucee.runtime.img.vecmath;
036
037/**
038 * Vector math package, converted to look similar to javax.vecmath.
039 */
040public class AxisAngle4f {
041        public float x, y, z, angle;
042
043        public AxisAngle4f() {
044                this( 0, 0, 0, 0 );
045        }
046        
047        public AxisAngle4f( float[] x ) {
048                this.x = x[0];
049                this.y = x[1];
050                this.z = x[2];
051                this.angle = x[2];
052        }
053
054        public AxisAngle4f( float x, float y, float z, float angle ) {
055                this.x = x;
056                this.y = y;
057                this.z = z;
058                this.angle = angle;
059        }
060
061        public AxisAngle4f( AxisAngle4f t ) {
062                this.x = t.x;
063                this.y = t.y;
064                this.z = t.z;
065                this.angle = t.angle;
066        }
067
068        public AxisAngle4f( Vector3f v, float angle ) {
069                this.x = v.x;
070                this.y = v.y;
071                this.z = v.z;
072                this.angle = angle;
073        }
074
075        public void set( float x, float y, float z, float angle ) {
076                this.x = x;
077                this.y = y;
078                this.z = z;
079                this.angle = angle;
080        }
081
082        public void set( AxisAngle4f t ) {
083                x = t.x;
084                y = t.y;
085                z = t.z;
086                angle = t.angle;
087        }
088
089        public void get( AxisAngle4f t ) {
090                t.x = x;
091                t.y = y;
092                t.z = z;
093                t.angle = angle;
094        }
095
096        public void get( float[] t ) {
097                t[0] = x;
098                t[1] = y;
099                t[2] = z;
100                t[3] = angle;
101        }
102
103        public String toString() {
104                return "["+x+", "+y+", "+z+", "+angle+"]";
105        }
106        
107}