#ifndef _HAIR_VR_PRIM_SHARED_FUCTIONS_H_ #define _HAIR_VR_PRIM_SHARED_FUCTIONS_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 /********************************************************************** *< FILE: shaveVraySharedFunctions.h DESCRIPTION: Various shared functions CREATED BY: Vladimir Dubovoy HISTORY: created 21-08-2008 ( as part of 3ds Max + VRay hair shaders) merged 31-03-2010 *> **********************************************************************/ #include #include "hairAPIvray.h" // The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the HAIRVRAY_EXPORTS // symbol defined on the command line. this symbol should not be defined on any project // that uses this DLL. This way any other project whose source files include this file see // SHAVEVRAYSH_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. #ifdef WIN32 #ifdef HAIRVRAY_EXPORTS #define HAIRVRAY_API __declspec(dllexport) #else #define HAIRVRAY_API __declspec(dllimport) #endif #else #define HAIRVRAY_API #endif #ifdef WIN32 extern HINSTANCE hInstance; #endif extern PFNCREATEBSDFPOOL CreateShaveBSDFPool; bool LoadShaveBSDFPoolLib(const char* libPath = NULL); void UnLoadShaveBSDFPoolLib(); inline void GenOrthVectors(const VR::Vector& in, VR::Vector& u, VR::Vector& v) { u = (in.x != 0.0f || in.y != 0.0f) ? normalize(VR::Vector(-in.y, in.x, 0.0f)) : VR::Vector(1.0f, 0.0f, 0.0f); v = normalize(in^u); } #endif //end of_HAIR_VR_PRIM_SHARED_FUCTIONS_H_