资源简介
cocos2d-android源代码及jar包,网上找了好久都没找到,温馨提示,如果你关联源码的时候,出现提示:“The Jar of this class file belongs to container 'Android Dependencies' which does not allow modifications to source attachments on its entries”那是因为你把包放在libs文件夹下面了,解决方案:新建一个lib文件夹,然后把jar包放在lib文件夹即可,放在libs下面就无法关联了=_=
代码片段和文件信息
/*
* Copyright 2010 Mario Zechner (contact@badlogicgames.com) Nathan Sweet (admin@esotericsoftware.com)
*
* Licensed under the Apache License Version 2.0 (the “License“); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software distributed under the License is distributed on an “AS IS“
* BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package com.badlogic.gdx.math;
import java.util.ArrayList;
import java.util.List;
/**
* Encapsulates a catmull rom spline with n control points n >= 4. For more
* information on this type of spline see
* http://www.mvps.org/directx/articles/catmull/.
*
* @author badlogicgames@gmail.com
*
*/
public final class CatmullRomSpline {
/**
*
*/
private static final long serialVersionUID = -3290464799289771451L;
private List controlPoints = new ArrayList();
/**
* Adds a new control point
*
* @param point
* the point
*/
public void add(Vector3 point) {
controlPoints.add(point);
}
/**
* @return all control points
*/
public List getControlPoints() {
return controlPoints;
}
/**
* Returns a path between every two control points numPoints are generated
* and the control points themselves are added too. The first and the last
* controlpoint are omitted. if there‘s less than 4 controlpoints an empty
* path is returned.
*
* @param numPoints
* number of points returned for a segment
* @return the path
*/
public List getPath(int numPoints) {
ArrayList points = new ArrayList();
if (controlPoints.size() < 4)
return points;
Vector3 T1 = new Vector3();
Vector3 T2 = new Vector3();
for (int i = 1; i <= controlPoints.size() - 3; i++) {
points.add(controlPoints.get(i));
float increment = 1.0f / (numPoints + 1);
float t = increment;
T1.set(controlPoints.get(i + 1)).sub(controlPoints.get(i - 1))
.mul(0.5f);
T2.set(controlPoints.get(i + 2)).sub(controlPoints.get(i))
.mul(0.5f);
for (int j = 0; j < numPoints; j++) {
float h1 = 2 * t * t * t - 3 * t * t + 1; // calculate basis
// function 1
float h2 = -2 * t * t * t + 3 * t * t; // calculate basis
// function 2
float h3 = t * t * t - 2 * t * t + t; // calculate basis
// function 3
float h4 = t * t * t - t * t; // calculate basis function 4
Vector3 point = new Vector3(controlPoints.get(i)).mul(h1);
point.add(controlPoints.get(i + 1).tmp().mul(h2));
point.add(T1.tmp().mul(h3));
point.add(T2.tmp().mul(h4));
points.add(point);
t += increment;
}
}
if (controlPoints.size() >= 4)
points.add(controlPoints.get(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 660980 2013-10-10 14:24 cocos2d-android源代码及jar包\cocos2d-android.jar
文件 219 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\.svn\entries
文件 218 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\.svn\entries
文件 222 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\.svn\entries
文件 253 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\.svn\entries
文件 2097 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\entries
文件 7055 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 10089 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 8595 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 19084 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 5913 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 24514 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 5069 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 4438 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 2567 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 5071 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 13115 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 3379 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\.svn\text-ba
文件 7055 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\CatmullRomSpline.java
文件 838 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\.svn\entries
文件 8564 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\.svn\text-ba
文件 3399 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\.svn\text-ba
文件 1731 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\.svn\text-ba
文件 1233 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\.svn\text-ba
文件 8564 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\BoundingBox.java
文件 3399 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\Ray.java
文件 1731 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\Segment.java
文件 1233 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\collision\Sphere.java
文件 10089 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\EarCutTriangulator.java
文件 8595 2013-10-10 13:14 cocos2d-android源代码及jar包\cocos2d源码\cocos2d\com\badlogic\gdx\math\Frustum.java
............此处省略807个文件信息
相关资源
- Android 日历、Android 农历日历 Android
- 手机投票APP
- android中图片的缩放,飞入,旋转,渐
- android 绘制折线图AChartEngineLinechart 动
- 聚合数据 Android 项目开发实战:
- 日记本java源代码
- 基于Android的简易备忘录的设计与开发
- 关于android订票系统以及项目设计文档
- Android 流量与网速监测悬浮窗 源码
- C#与Android Socket通信
- Android 拍照上传图片
- Android入门之认识Android Activity
- 认识Android布局文件
- android个人计划日程安排课程系统源码
- JSP+MYSQL银行客户理财投资系统 源代码
- dex2jar-0.0.9.15
- 基于Android自带API的 静态图片人脸检测
- android通讯录分组管理
- JSP基于WEB的图书馆借阅系统的设计与
- Android实现的数据库课设
- 基于android的贪吃蛇游戏设计与开发报
- Android音乐播放器毕业设计论文
- android手机短信管理系统论文 完整版
- 百度地图android开发所需jar包和so文件
- Android:LocationManager定位demo
- Android基于wifi模块的局域网聊天以及文
- Android蓝牙录音
- Android代码-数独游戏
- Mastering Android NDK.
- Android应用源码基于位置的服务(LBS)
评论
共有 条评论