mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 18:23:22 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into daft
This commit is contained in:
commit
2968286779
5 changed files with 37 additions and 13 deletions
25
examples/example/games/airHockey.js
Normal file → Executable file
25
examples/example/games/airHockey.js
Normal file → Executable file
|
@ -83,6 +83,30 @@ var puck_name_index = 2;
|
|||
var light_name_index = 3;
|
||||
var floor_name_index = 4;
|
||||
|
||||
//Create Spawn and Del. Button Vars.
|
||||
|
||||
function updateButtonPosition() {
|
||||
Overlays.editOverlay(spawnButton, {
|
||||
x: screenSize.x / 2 + PADDING,
|
||||
y: screenSize.y - (BUTTON_SIZE * 2 + PADDING),
|
||||
});
|
||||
Overlays.editOverlay(deleteButton, {
|
||||
x: screenSize.x / 2 - BUTTON_SIZE,
|
||||
y: screenSize.y - (BUTTON_SIZE * 2 + PADDING),
|
||||
});
|
||||
}
|
||||
|
||||
function onScriptUpdate() {
|
||||
var oldScreenSize = screenSize;
|
||||
|
||||
screenSize = Controller.getViewportDimensions();
|
||||
|
||||
if (screenSize.x !== oldScreenSize.x || screenSize.y !== oldScreenSize.y) {
|
||||
updateButtonPosition();
|
||||
}
|
||||
}
|
||||
|
||||
screenSize = Controller.getViewportDimensions();
|
||||
|
||||
var deleteButton = Overlays.addOverlay("image", {
|
||||
x: screenSize.x / 2 - BUTTON_SIZE,
|
||||
|
@ -112,6 +136,7 @@ var spawnButton = Overlays.addOverlay("image", {
|
|||
alpha: 1
|
||||
});
|
||||
|
||||
Script.update.connect(onScriptUpdate);
|
||||
|
||||
|
||||
var floor, edge1, edge2, edge3a, edge3b, edge4a, edge4b, light;
|
||||
|
|
|
@ -3387,14 +3387,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
|||
// load the view frustum
|
||||
loadViewFrustum(theCamera, _displayViewFrustum);
|
||||
|
||||
// flip x if in mirror mode (also requires reversing winding order for backface culling)
|
||||
if (theCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||
//glScalef(-1.0f, 1.0f, 1.0f);
|
||||
//glFrontFace(GL_CW);
|
||||
} else {
|
||||
glFrontFace(GL_CCW);
|
||||
}
|
||||
|
||||
// transform view according to theCamera
|
||||
// could be myCamera (if in normal mode)
|
||||
// or could be viewFrustumOffsetCamera if in offset mode
|
||||
|
@ -3412,9 +3404,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
|||
Transform viewTransform;
|
||||
viewTransform.setTranslation(theCamera.getPosition());
|
||||
viewTransform.setRotation(rotation);
|
||||
if (theCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||
// viewTransform.setScale(Transform::Vec3(-1.0f, 1.0f, 1.0f));
|
||||
}
|
||||
if (renderArgs->_renderSide != RenderArgs::MONO) {
|
||||
glm::mat4 invView = glm::inverse(_untranslatedViewMatrix);
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ void DrawOpaqueDeferred::run(const SceneContextPointer& sceneContext, const Rend
|
|||
args->_viewFrustum->evalProjectionMatrix(projMat);
|
||||
args->_viewFrustum->evalViewTransform(viewMat);
|
||||
if (args->_renderMode == RenderArgs::MIRROR_RENDER_MODE) {
|
||||
viewMat.postScale(glm::vec3(-1.0f, 1.0f, 1.0f));
|
||||
viewMat.preScale(glm::vec3(-1.0f, 1.0f, 1.0f));
|
||||
}
|
||||
batch.setProjectionTransform(projMat);
|
||||
batch.setViewTransform(viewMat);
|
||||
|
|
|
@ -493,7 +493,7 @@ void ScriptEngine::evaluate() {
|
|||
|
||||
QScriptValue result = evaluate(_scriptContents);
|
||||
|
||||
// TODO: why do we check this twice? It seems like the call to clearExcpetions() in the lower level evaluate call
|
||||
// TODO: why do we check this twice? It seems like the call to clearExceptions() in the lower level evaluate call
|
||||
// will cause this code to never actually run...
|
||||
if (hasUncaughtException()) {
|
||||
int line = uncaughtExceptionLineNumber();
|
||||
|
|
|
@ -97,6 +97,8 @@ public:
|
|||
const Vec3& getScale() const;
|
||||
void setScale(float scale);
|
||||
void setScale(const Vec3& scale); // [new this] = [this.translation] * [this.rotation] * [scale]
|
||||
void preScale(float scale);
|
||||
void preScale(const Vec3& scale);
|
||||
void postScale(float scale); // [new this] = [this] * [scale] equivalent to glScale
|
||||
void postScale(const Vec3& scale); // [new this] = [this] * [scale] equivalent to glScale
|
||||
|
||||
|
@ -322,6 +324,14 @@ inline void Transform::setScale(const Vec3& scale) {
|
|||
}
|
||||
}
|
||||
|
||||
inline void Transform::preScale(float scale) {
|
||||
setScale(getScale() * scale);
|
||||
}
|
||||
|
||||
inline void Transform::preScale(const Vec3& scale) {
|
||||
setScale(getScale() * scale);
|
||||
}
|
||||
|
||||
inline void Transform::postScale(float scale) {
|
||||
if (!isValidScale(scale) || scale == 1.0f) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue