|
From: <cn...@us...> - 2010-02-24 05:40:31
|
Revision: 680
http://hgengine.svn.sourceforge.net/hgengine/?rev=680&view=rev
Author: cnlohr
Date: 2010-02-24 05:40:25 +0000 (Wed, 24 Feb 2010)
Log Message:
-----------
forgot to add some stuff :(
Added Paths:
-----------
Mercury2/modules/Skybox.cpp
Mercury2/modules/Skybox.h
Added: Mercury2/modules/Skybox.cpp
===================================================================
--- Mercury2/modules/Skybox.cpp (rev 0)
+++ Mercury2/modules/Skybox.cpp 2010-02-24 05:40:25 UTC (rev 680)
@@ -0,0 +1,72 @@
+#include "Skybox.h"
+#include <Camera.h>
+#include <MercuryMessageManager.h>
+
+REGISTER_NODE_TYPE(Skybox);
+
+Skybox::Skybox()
+ :TransformNode(), m_bFirst(true)
+{
+ REGISTER_MESSAGE_WITH_DELEGATE( "SetCameraPosition", &Skybox::SetCameraPosition );
+}
+
+Skybox::~Skybox()
+{
+ UNREGISTER_FOR_MESSAGE( "SetCameraPosition" );
+}
+
+
+void Skybox::SetCameraPosition(const MessageData& data)
+{
+ const VertexDataMessage& m( dynamic_cast<const VertexDataMessage&>( data ) );
+
+ if( !m_bFirst )
+ SetPosition(m.Vertex);
+}
+
+void Skybox::RecursivePreRender()
+{
+/* CameraNode * cn = CameraNode::GetLastPreRenderedCamera();
+ if( cn )
+ {
+ const MercuryVertex& cp = cn->GetPosition();
+ cn->ComputeMatrix();
+ SetPosition( cp );
+ ComputeMatrix();
+ }
+*/
+ TransformNode::RecursivePreRender( );
+ m_bFirst = false;
+}
+
+/****************************************************************************
+ * Copyright (C) 2010 by Charles Lohr *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Added: Mercury2/modules/Skybox.h
===================================================================
--- Mercury2/modules/Skybox.h (rev 0)
+++ Mercury2/modules/Skybox.h 2010-02-24 05:40:25 UTC (rev 680)
@@ -0,0 +1,54 @@
+#ifndef Skybox_H
+#define Skybox_H
+
+#include <TransformNode.h>
+
+class Skybox : public TransformNode
+{
+public:
+ Skybox();
+ ~Skybox();
+ virtual void RecursivePreRender();
+
+ void SetCameraPosition(const MessageData& data);
+
+ GENRTTI(Skybox);
+private:
+ bool m_bFirst;
+};
+
+#endif
+
+
+/****************************************************************************
+ * Copyright (C) 2010 by Charles Lohr *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|