VCTravel
#pragma once
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer>
#include <osgDB/ReadFile>
#include <osg/Geode>
#include <osg/Node>
#include <osgGA/TrackballManipulator>
#include <osg/GraphicsContext>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osg/TexGen>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/AnimationPath>
#include <osg/Matrixd> #include <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator> class VCTravel :
//public MatrixManipulator
public osgGA::CameraManipulator
{
public:
VCTravel();
~VCTravel(); //设置当前视口
virtual void setByMatrix(const osg::Matrixd& matrix);
//
virtual void setByInverseMatrix(const osg::Matrixd& matrix);
//获取
virtual osg::Matrixd getMatrix() const;
//得到矩阵逆
virtual osg::Matrixd getInverseMatrix() const; private:
//视点
osg::Vec3 vec_position;
//方向
osg::Vec3 vec_rotation; };
#include "VCTravel.h" VCTravel::VCTravel()
{
vec_position = osg::Vec3(0.0,0.0,0.0);
vec_rotation = osg::Vec3(0.0, 0.0, 0.0);
} VCTravel::~VCTravel()
{ } //设置当前视口
void VCTravel::setByMatrix(const osg::Matrixd& matrix)
{ }
//
void VCTravel::setByInverseMatrix(const osg::Matrixd& matrix)
{ }
//获取
osg::Matrixd VCTravel::getMatrix() const
{
osg::Matrixd mat;
mat.makeTranslate(vec_position);
return mat*osg::Matrixd::rotate(vec_rotation[], osg::X_AXIS, vec_rotation[], osg::Y_AXIS, vec_rotation[], osg::Z_AXIS);
}
//得到矩阵逆
osg::Matrixd VCTravel::getInverseMatrix() const
{
osg::Matrixd mat;
mat.makeTranslate(vec_position);
//return mat*osg::Matrixd::rotate(vec_rotation[0], osg::X_AXIS, vec_rotation[1], osg::Y_AXIS, vec_rotation[2], osg::Z_AXIS);
return osg::Matrixd::inverse(mat*osg::Matrixd::rotate(vec_rotation[], osg::X_AXIS, vec_rotation[], osg::Y_AXIS, vec_rotation[], osg::Z_AXIS));
}
VCTravel的更多相关文章
随机推荐
- ElasticSearch 连载一 基础入门
ElasticSearch简写ES,ES是一个高扩展.开源的全文检索和分析引擎,它可以准实时地快速存储.搜索.分析海量的数据. 应用场景 我们常见的商城商品的搜索 日志分析系统(ELK) 基于大量数据 ...
- Mybatis3.0-[tp_28-29]-映射文件-resultMap_自定义结果集映射规则_及关联环境的搭建
笔记要点出错分析与总结工程组织 1.定义接口 EmployeeMapperPlus.java package com.dao; import com.bean.*; public interface ...
- 题解 洛谷P1290 【欧几里德的游戏】
这题没必要那么麻烦,只需要推理一下即可: 假设我们有两个数\(x,y\),先把\(x\)设为较大值,\(y\)设为较小值.现在分成三种情况: \(1\).若两数为倍数关系,操作的一方赢. \(2\). ...
- GO 文件读取常用的方法
方式1: 一行一行的方式读取 其中常用的方法就有:ReadString,ReadLine,ReadBytes ReadLine 返回单个行,不包括行尾字节,就是说,返回的内容不包括\n或者\r\n,返 ...
- Python 如何理解可更改元组中的可变序列
在 Python 中,元组是不可变序列,那为什么当元组中的元素是可变序列时(如 list.dict)可进行增删的操作? 在定义一个元组时,Python内部会为元组中的每一个元素分配一个内存地址,当我们 ...
- [Cypress] install, configure, and script Cypress for JavaScript web applications -- part5
Use the Most Robust Selector for Cypress Tests Which selectors your choose for your tests matter, a ...
- 第十三章 使用ADO.NET访问数据库
一,什么是ADO.NET ADO.NET 是一种以面向对象的设计方法构建的数据访问和操作的类库,它建立在.NET平台上,以便于操作各种各样的数据源.这些数据源可以是数据库, 也可以是文本文件 ,EXC ...
- list获取所有上级
/// <summary> /// 获取所有上级 /// </summary> /// <param name="list"></para ...
- guava字符串工具 Strings 校验补全 转换null和""
public class StringsTest { public static void main(String args[]){ //1.补右全(Strings.padEnd方法) String ...
- Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算
目标:Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算 1.flume的配置,配置spoolDirSource_hdfsSink.pro ...