VIZ++ Class: Vector4f

 VIZ++ Class Library  VIZ++ Samples  VIZ++ ClassTree 

Source code

/*
 * Vector4f.h 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <viz++/Vector.h>
#include <viz++/Vertex.h>

namespace VIZ {

#define DIM_FOUR (4)
  
class Vector4f : public Vector<float, DIM_FOUR> {

public:
  Vector4f()
  :Vector<float, DIM_FOUR>()
  {
  }
  
  Vector4f(float x, float y, float z, float w)
  :Vector<float, DIM_FOUR>()
  {
    float f[DIM_FOUR];
    f[0] = x;
    f[1] = y;
    f[2] = z;
    f[3] = w;
    set(f, CountOf(f));
  }
  
  Vector4f(const Vector<float, DIM_FOUR>& vec)
  :Vector<float, DIM_FOUR>(vec)
  {
  }

  Vector4f(const Vertex<4> vertex)
  :Vector<float, DIM_FOUR>()
  {
    float f[DIM_FOUR];
    for (int i = 0; i<DIM_FOUR; i++) {
      f[i] = vertex.value[i];
    }
    set(f, CountOf(f));
  }
};
  

}



Last modified: 10 Feb 2017

Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.