Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump up dependency to use opentk 3 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions Demos/TestBench0/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
8 changes: 6 additions & 2 deletions Demos/TestBench0/TestBench0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<Compile Include="TestBench0_setupScene.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK">
<HintPath>..\..\Libs\OpenTK.dll</HintPath>
<Reference Include="OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.1.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
</ItemGroup>
Expand All @@ -69,4 +69,8 @@
<Name>_SimpleScene</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Demos/TestBench0/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.1.0" targetFramework="net40" />
</packages>
25 changes: 25 additions & 0 deletions Demos/TestBench1/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
10 changes: 7 additions & 3 deletions Demos/TestBench1/TestBench1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,19 @@
<Compile Include="TestBench1_renderScene.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Drawing" />
<Reference Include="OpenTK">
<HintPath>..\..\Libs\OpenTK.dll</HintPath>
<Reference Include="OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.1.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SimpleScene\_SimpleScene.csproj">
<Project>{4A7A056C-CB90-4F29-95DE-EAC471A6CBD7}</Project>
<Name>_SimpleScene</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Demos/TestBench1/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.1.0" targetFramework="net40" />
</packages>
25 changes: 25 additions & 0 deletions Demos/TestBench2/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
8 changes: 6 additions & 2 deletions Demos/TestBench2/TestBench2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Reference Include="OpenTK">
<HintPath>..\..\Libs\OpenTK.dll</HintPath>
<Reference Include="OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.1.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
</ItemGroup>
Expand All @@ -65,4 +65,8 @@
<Name>_SimpleScene</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Demos/TestBench2/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.1.0" targetFramework="net40" />
</packages>
25 changes: 25 additions & 0 deletions Demos/TestBench3/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
8 changes: 6 additions & 2 deletions Demos/TestBench3/TestBench3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK">
<HintPath>..\..\Libs\OpenTK.dll</HintPath>
<Reference Include="OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.1.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="TestBench3.cs" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Demos/TestBench3/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.1.0" targetFramework="net45" />
</packages>
25 changes: 25 additions & 0 deletions Demos/TestBench4-BVH/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
8 changes: 6 additions & 2 deletions Demos/TestBench4-BVH/TestBench4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<Compile Include="TestBench4_setupScene.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK">
<HintPath>..\..\Libs\OpenTK.dll</HintPath>
<Reference Include="OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.1.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
</ItemGroup>
Expand All @@ -69,4 +69,8 @@
<Name>_SimpleScene</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Demos/TestBench4-BVH/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.1.0" targetFramework="net40" />
</packages>
7 changes: 6 additions & 1 deletion SimpleScene/Core/SSAABB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ public void ExpandBy(SSAABB b)
inverse.Invert();
for (int i = 0; i < c_homogenousCorners.Length; ++i) {
Vector4 corner = Vector4.Transform(c_homogenousCorners [i], inverse);
Vector3 transfPt = Vector3.Transform(corner.Xyz / corner.W, axisTransform);
//Vector3 transfPt = Vector3.Transform(corner.Xyz / corner.W, axisTransform);

//some_name code start 24112019
Vector3 transfPt = (new Vector4(corner.Xyz / corner.W, 1) * axisTransform).Xyz;
//some_name code end

ret.UpdateMin(transfPt);
ret.UpdateMax(transfPt);
}
Expand Down
9 changes: 8 additions & 1 deletion SimpleScene/Core/SSMainShaderProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,17 @@ public SSMainShaderProgram (string preprocessorDefs = null)

m_geometryShader = SSAssetManager.GetInstance<SSGeometryShader>(
Path.Combine(c_basePath, "ss4_geometry.glsl"));
/*
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryInputTypeExt, (int)All.Triangles);
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryOutputTypeExt, (int)All.TriangleStrip);
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryVerticesOutExt, 3);
m_geometryShader.Prepend (preprocessorDefs);
*/
// some_name code start 24112019
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryInputTypeExt, (int)All.Triangles);
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryOutputTypeExt, (int)All.TriangleStrip);
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryVerticesOutExt, 3);
// some_name code end
m_geometryShader.Prepend (preprocessorDefs);
m_geometryShader.LoadShader();
attach(m_geometryShader);
load_fallback_shader = false;
Expand Down
7 changes: 7 additions & 0 deletions SimpleScene/Core/SSPssmShaderProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,16 @@ public SSPssmShaderProgram(string preprocessorDefs = null)
Path.Combine(c_basePath, "pssm_geometry.glsl"));
m_geometryShader.Prepend (preprocessorDefs);
m_geometryShader.LoadShader();
/*
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryInputTypeExt, (int)All.Triangles);
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryOutputTypeExt, (int)All.TriangleStrip);
GL.Ext.ProgramParameter (m_programID, ExtGeometryShader4.GeometryVerticesOutExt, 3 * SSParallelSplitShadowMap.c_numberOfSplits);
*/
// some_name code start 24112019
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryInputTypeExt, (int)All.Triangles);
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryOutputTypeExt, (int)All.TriangleStrip);
GL.Ext.ProgramParameter(m_programID, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)ExtGeometryShader4.GeometryVerticesOutExt, 3 * SSParallelSplitShadowMap.c_numberOfSplits);
// some_name code end
attach(m_geometryShader);
link();
Activate();
Expand Down
15 changes: 9 additions & 6 deletions SimpleScene/Core/SSRay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ public struct SSRay
}

public SSRay Transformed(Matrix4 mat) {
// a point is directly transformed
// however, a ray is only rotationally transformed.
return new SSRay( Vector3.Transform(pos, mat) , Vector3.Transform(dir,mat.ExtractRotation()).Normalized() );
}

public override string ToString() {
// a point is directly transformed
// however, a ray is only rotationally transformed.
// return new SSRay( Vector3.Transform(pos, mat) , Vector3.Transform(dir,mat.ExtractRotation()).Normalized() );
// some_name code start 24112019
return new SSRay((new Vector4(pos.X, pos.Y, pos.Z,1)* mat).Xyz, Vector3.Transform(dir, mat.ExtractRotation()).Normalized());
// some_name code end
}

public override string ToString() {
return String.Format("({0}) -> v({1})",pos,dir);
}
}
Expand Down
8 changes: 5 additions & 3 deletions SimpleScene/Core/SSShaderProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ public void debugLocations()
for (int i = 0; i < activeAttr; i++) {
int size, length;
ActiveAttribType type;
System.Text.StringBuilder name = new System.Text.StringBuilder (maxLength);

GL.GetActiveAttrib (m_programID, i, maxLength, out length, out size, out type, name);
//System.Text.StringBuilder name = new System.Text.StringBuilder (maxLength);
// some_name code start 24112019
System.String name = maxLength.ToString();
GL.GetActiveAttrib (m_programID, i, maxLength, out length, out size, out type, out name);
// some_name code end 24112019
int location = GL.GetAttribLocation (m_programID, name.ToString ());
info.Add((location >= 0) ? location : (location*i),
String.Format("{0} {1} is at location {2}, size {3}",
Expand Down
12 changes: 9 additions & 3 deletions SimpleScene/Extra/Lasers/SLaser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ internal Vector3 txfmSourceToWorld(Vector3 localPos)
if (sourceObject != null) {
mat = mat * sourceObject.worldMat;
}
return Vector3.Transform(localPos, mat);
//return Vector3.Transform(localPos, mat);
//some_name code start 24112019
return (new Vector4(localPos, 1) * mat).Xyz;
//some_name code end
}

internal Vector3 txfmTargetToWorld(Vector3 localPos)
Expand All @@ -163,9 +166,12 @@ internal Vector3 txfmTargetToWorld(Vector3 localPos)
if (targetObject != null) {
mat = mat * targetObject.worldMat;
}
return Vector3.Transform(localPos, mat);
//return Vector3.Transform(localPos, mat);
//some_name code start 24112019
return (new Vector4(localPos, 1) * mat).Xyz;
//some_name code end
}

}
}
}